71.14.3 problem 9

Internal problem ID [14466]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 5. The Laplace Transform Method. Exercises 5.3, page 255
Problem number : 9
Date solved : Monday, March 31, 2025 at 12:27:48 PM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} y^{\prime \prime }+9 y&=1 \end{align*}

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=0\\ y^{\prime }\left (0\right )&=0 \end{align*}

Maple. Time used: 0.094 (sec). Leaf size: 12
ode:=diff(diff(y(x),x),x)+9*y(x) = 1; 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(x),method='laplace');
 
\[ y = -\frac {\cos \left (3 x \right )}{9}+\frac {1}{9} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 17
ode=D[y[x],{x,2}]+9*y[x]==1; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {2}{9} \sin ^2\left (\frac {3 x}{2}\right ) \]
Sympy. Time used: 0.087 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) + Derivative(y(x), (x, 2)) - 1,0) 
ics = {y(0): 0, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {1}{9} - \frac {\cos {\left (3 x \right )}}{9} \]