84.43.2 problem 37.3

Internal problem ID [22397]
Book : Schaums outline series. Differential Equations By Richard Bronson. 1973. McGraw-Hill Inc. ISBN 0-07-008009-7
Section : Chapter 37. Second Order Boundary Value Problems. Solved problems
Problem number : 37.3
Date solved : Thursday, October 02, 2025 at 08:38:15 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ y^{\prime }\left (1\right )&=2 \\ \end{align*}
Maple. Time used: 0.049 (sec). Leaf size: 46
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)-3*y(x) = 9*x; 
ic:=[y(0) = 1, D(y)(1) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {5 \,{\mathrm e}^{x} {\mathrm e}^{3}+9 \,{\mathrm e}^{x}}{{\mathrm e}^{4}+3}+\frac {{\mathrm e}^{3-3 x} \left (3 \,{\mathrm e}-5\right )}{{\mathrm e}^{4}+3}-3 x -2 \]
Mathematica. Time used: 0.01 (sec). Leaf size: 58
ode=D[y[x],{x,2}]+2*D[y[x],x]-3*y[x]==9*x; 
ic={y[0]==1,Derivative[1][y][1] ==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {9 x+5 e^{3-3 x}-3 e^{4-3 x}-9 e^x-5 e^{x+3}+e^4 (3 x+2)+6}{3+e^4} \end{align*}
Sympy. Time used: 0.124 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-9*x - 3*y(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 1): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - 3 x + \frac {\left (9 + 5 e^{3}\right ) e^{x}}{3 + e^{4}} - 2 + \frac {\left (- 5 e^{3} + 3 e^{4}\right ) e^{- 3 x}}{3 + e^{4}} \]