38.3.7 problem 7

Internal problem ID [6485]
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 : 7
Date solved : Wednesday, March 05, 2025 at 12:51:54 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} 3 y^{\prime \prime }-2 y^{\prime }-y&=2 x -3 \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 19
ode:=3*diff(diff(y(x),x),x)-2*diff(y(x),x)-y(x) = 2*x-3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {x}{3}} c_2 +{\mathrm e}^{x} c_1 -2 x +7 \]
Mathematica. Time used: 0.016 (sec). Leaf size: 26
ode=3*D[y[x],{x,2}]-2*D[y[x],x]-y[x]==2*x-3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -2 x+c_1 e^{-x/3}+c_2 e^x+7 \]
Sympy. Time used: 0.184 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x - y(x) - 2*Derivative(y(x), x) + 3*Derivative(y(x), (x, 2)) + 3,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \frac {x}{3}} + C_{2} e^{x} - 2 x + 7 \]