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, March 04, 2025 at 05:53:29 PM
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,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)