82.33.14 problem Ex. 14

Internal problem ID [18828]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. Examples on chapter VI, page 80
Problem number : Ex. 14
Date solved : Thursday, March 13, 2025 at 01:00:13 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+n^{2} y&={\mathrm e}^{x} x^{4} \end{align*}

Maple. Time used: 0.010 (sec). Leaf size: 129
ode:=diff(diff(y(x),x),x)+n^2*y(x) = x^4*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {c_{1} \left (n^{2}+1\right )^{5} \cos \left (n x \right )+c_{2} \left (n^{2}+1\right )^{5} \sin \left (n x \right )+\left (120+n^{8} x^{4}+4 \left (x^{4}-2 x^{3}-3 x^{2}\right ) n^{6}+6 \left (x^{4}-4 x^{3}+2 x^{2}+16 x +4\right ) n^{4}+4 \left (x^{4}-6 x^{3}+15 x^{2}-60\right ) n^{2}+x^{4}-8 x^{3}+36 x^{2}-96 x \right ) {\mathrm e}^{x}}{\left (n^{2}+1\right )^{5}} \]
Mathematica. Time used: 0.046 (sec). Leaf size: 115
ode=D[y[x],{x,2}]+n^2*y[x]==Exp[x]*x^4; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^x \left (n^8 x^4+4 n^6 x^2 \left (x^2-2 x-3\right )+6 n^4 \left (x^4-4 x^3+2 x^2+16 x+4\right )+4 n^2 \left (x^4-6 x^3+15 x^2-60\right )+x^4-8 x^3+36 x^2-96 x+120\right )}{\left (n^2+1\right )^5}+c_1 \cos (n x)+c_2 \sin (n x) \]
Sympy. Time used: 0.341 (sec). Leaf size: 257
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(n**2*y(x) - x**4*exp(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- i n x} + C_{2} e^{i n x} + \frac {24 n^{4} e^{x}}{n^{10} + 5 n^{8} + 10 n^{6} + 10 n^{4} + 5 n^{2} + 1} - \frac {12 n^{2} x^{2} e^{x}}{n^{6} + 3 n^{4} + 3 n^{2} + 1} + \frac {96 n^{2} x e^{x}}{n^{8} + 4 n^{6} + 6 n^{4} + 4 n^{2} + 1} - \frac {240 n^{2} e^{x}}{n^{10} + 5 n^{8} + 10 n^{6} + 10 n^{4} + 5 n^{2} + 1} + \frac {x^{4} e^{x}}{n^{2} + 1} - \frac {8 x^{3} e^{x}}{n^{4} + 2 n^{2} + 1} + \frac {36 x^{2} e^{x}}{n^{6} + 3 n^{4} + 3 n^{2} + 1} - \frac {96 x e^{x}}{n^{8} + 4 n^{6} + 6 n^{4} + 4 n^{2} + 1} + \frac {120 e^{x}}{n^{10} + 5 n^{8} + 10 n^{6} + 10 n^{4} + 5 n^{2} + 1} \]