75.5.20 problem 20

Internal problem ID [19968]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter IV. Ordinary linear differential equations with constant coefficients. Exercises at page 58
Problem number : 20
Date solved : Thursday, October 02, 2025 at 05:04:35 PM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} e y^{\prime \prime }&=P \left (a -y\right ) \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 28
ode:=e*diff(diff(y(x),x),x) = P*(a-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (\frac {\sqrt {P}\, x}{\sqrt {e}}\right ) c_2 +\cos \left (\frac {\sqrt {P}\, x}{\sqrt {e}}\right ) c_1 +a \]
Mathematica. Time used: 0.012 (sec). Leaf size: 39
ode=e*D[y[x],{x,2}]==P*(a-y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to a+c_1 \cos \left (\frac {\sqrt {P} x}{\sqrt {e}}\right )+c_2 \sin \left (\frac {\sqrt {P} x}{\sqrt {e}}\right ) \end{align*}
Sympy. Time used: 0.050 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
P = symbols("P") 
a = symbols("a") 
e = symbols("e") 
y = Function("y") 
ode = Eq(-P*(a - y(x)) + e*Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x \sqrt {- \frac {P}{e}}} + C_{2} e^{x \sqrt {- \frac {P}{e}}} + a \]