75.5.19 problem 19

Internal problem ID [19967]
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 : 19
Date solved : Thursday, October 02, 2025 at 05:04:34 PM
CAS classification : [[_2nd_order, _quadrature]]

\begin{align*} e y^{\prime \prime }&=-P L +\left (w L +P \right ) x -\frac {w \left (L^{2}+x^{2}\right )}{2} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 50
ode:=e*diff(diff(y(x),x),x) = -P*L+(L*w+P)*x-1/2*w*(L^2+x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-w \,x^{4}+\left (4 w L +4 P \right ) x^{3}-6 L \left (w L +2 P \right ) x^{2}+24 c_1 x e +24 c_2 e}{24 e} \]
Mathematica. Time used: 0.009 (sec). Leaf size: 47
ode=e*D[y[x],{x,2}]==-P*L+(P+w*L)*x-w/2*(L^2+x^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x^2 \left (6 L^2 w+12 L P-4 L w x-4 P x+w x^2\right )}{24 e}+c_2 x+c_1 \end{align*}
Sympy. Time used: 0.089 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
L = symbols("L") 
P = symbols("P") 
e = symbols("e") 
w = symbols("w") 
y = Function("y") 
ode = Eq(L*P + e*Derivative(y(x), (x, 2)) + w*(L**2 + x**2)/2 - x*(L*w + P),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{2} x + \frac {L x^{2} \left (- L w - 2 P\right )}{4 e} - \frac {w x^{4}}{24 e} + \frac {x^{3} \left (L w + P\right )}{6 e} \]