75.5.18 problem 18

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

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