Internal
problem
ID
[4141]
Book
:
Theory
and
solutions
of
Ordinary
Differential
equations,
Donald
Greenspan,
1960
Section
:
Chapter
3.
Linear
differential
equations
of
second
order.
Exercises
at
page
31
Problem
number
:
9
Date
solved
:
Tuesday, September 30, 2025 at 07:06:01 AM
CAS
classification
:
[[_2nd_order, _linear, _nonhomogeneous]]
With initial conditions
ode:=diff(diff(y(x),x),x)+2*n*diff(y(x),x)+n^2*y(x) = A*cos(p*x); ic:=[y(0) = 9, D(y)(0) = 0]; dsolve([ode,op(ic)],y(x), singsol=all);
ode=D[y[x],{x,2}]+2*n*D[y[x],x]+n^2*y[x]==A*Cos[p*x]; ic={y[0]==0,Derivative[1][y][0] ==0}; DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
from sympy import * x = symbols("x") A = symbols("A") n = symbols("n") p = symbols("p") y = Function("y") ode = Eq(-A*cos(p*x) + n**2*y(x) + 2*n*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) ics = {y(0): 9, Subs(Derivative(y(x), x), x, 0): 0} dsolve(ode,func=y(x),ics=ics)