13.10.7 problem 7

Internal problem ID [2408]
Book : Differential equations and their applications, 3rd ed., M. Braun
Section : Section 2.4, The method of variation of parameters. Page 154
Problem number : 7
Date solved : Sunday, March 30, 2025 at 12:00:36 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-3 y^{\prime }+2 y&=\sqrt {1+t} \end{align*}

With initial conditions

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

Maple. Time used: 0.142 (sec). Leaf size: 90
ode:=diff(diff(y(t),t),t)-3*diff(y(t),t)+2*y(t) = (t+1)^(1/2); 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = -\frac {\sqrt {2}\, {\mathrm e}^{2+2 t} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {2}\right )}{8}+\frac {{\mathrm e}^{2 t}}{2}+\frac {\sqrt {2}\, \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {2}\, \sqrt {1+t}\right ) {\mathrm e}^{2+2 t}}{8}-\frac {\sqrt {\pi }\, \operatorname {erf}\left (\sqrt {1+t}\right ) {\mathrm e}^{1+t}}{2}+\frac {\sqrt {1+t}}{2}+\frac {\operatorname {erf}\left (1\right ) {\mathrm e}^{1+t} \sqrt {\pi }}{2}-{\mathrm e}^{t} \]
Mathematica. Time used: 0.432 (sec). Leaf size: 116
ode=D[y[t],{t,2}]-3*D[y[t],t]+2*y[t]==Sqrt[1+t]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {1}{8} \left (-4 \sqrt {\pi } e^{t+1} \text {erf}\left (\sqrt {t+1}\right )+\sqrt {2 \pi } e^{2 t+2} \text {erf}\left (\sqrt {2} \sqrt {t+1}\right )-\sqrt {2 \pi } \text {erf}\left (\sqrt {2}\right ) e^{2 t+2}+4 \sqrt {\pi } \text {erf}(1) e^{t+1}-8 e^t+4 e^{2 t}+4 \sqrt {t+1}\right ) \]
Sympy. Time used: 3.912 (sec). Leaf size: 60
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-sqrt(t + 1) + 2*y(t) - 3*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (\left (\int \sqrt {t + 1} e^{- 2 t}\, dt - \int \limits ^{0} \sqrt {t + 1} e^{- 2 t}\, dt\right ) e^{t} - \int \sqrt {t + 1} e^{- t}\, dt + \int \limits ^{0} \sqrt {t + 1} e^{- t}\, dt\right ) e^{t} \]