32.3.4 problem 4

Internal problem ID [7769]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 25. Second order differential equations. Test Excercise 25. page 1093
Problem number : 4
Date solved : Tuesday, September 30, 2025 at 05:05:15 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+25 y&=5 x^{2}+x \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)+25*y(x) = 5*x^2+x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (5 x \right ) c_2 +\cos \left (5 x \right ) c_1 +\frac {x^{2}}{5}+\frac {x}{25}-\frac {2}{125} \]
Mathematica. Time used: 0.011 (sec). Leaf size: 34
ode=D[y[x],{x,2}]+25*y[x]==5*x^2+x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{125} \left (25 x^2+5 x-2\right )+c_1 \cos (5 x)+c_2 \sin (5 x) \end{align*}
Sympy. Time used: 0.046 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-5*x**2 - x + 25*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (5 x \right )} + C_{2} \cos {\left (5 x \right )} + \frac {x^{2}}{5} + \frac {x}{25} - \frac {2}{125} \]