2.3.1.4 ✓ Maple. Time used: 0.046 (sec). Leaf size: 21
ode:=diff(diff(x(t),t),t)-x(t) = t^2;
ic:=[x(0) = 0, D(x)(0) = 1];
dsolve([ode,op(ic)],x(t), singsol=all);
\begin{align*} x = \frac {{\mathrm e}^{-t}}{2}+\frac {3 \,{\mathrm e}^{t}}{2}-t^{2}-2 \end{align*}
Maple trace
Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
trying differential order: 2; linear nonhomogeneous with symmetry [0,1]
trying a double symmetry of the form [xi=0, eta=F(x)]
-> Try solving first the homogeneous part of the ODE
checking if the LODE has constant coefficients
<- constant coefficients successful
<- solving first the homogeneous part of the ODE successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d^{2}}{d t^{2}}x \left (t \right )-x \left (t \right )=t^{2}, x \left (0\right )=0, \left (\frac {d}{d t}x \left (t \right )\right )\bigg | {\mstack {}{_{\left \{t \hiderel {=}0\right \}}}}=1\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d^{2}}{d t^{2}}x \left (t \right ) \\ \bullet & {} & \textrm {Characteristic polynomial of homogeneous ODE}\hspace {3pt} \\ {} & {} & r^{2}-1=0 \\ \bullet & {} & \textrm {Factor the characteristic polynomial}\hspace {3pt} \\ {} & {} & \left (r -1\right ) \left (r +1\right )=0 \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (-1, 1\right ) \\ \bullet & {} & \textrm {1st solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & x_{1}\left (t \right )={\mathrm e}^{-t} \\ \bullet & {} & \textrm {2nd solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & x_{2}\left (t \right )={\mathrm e}^{t} \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & x \left (t \right )=\mathit {C1} x_{1}\left (t \right )+\mathit {C2} x_{2}\left (t \right )+x_{p}\left (t \right ) \\ \bullet & {} & \textrm {Substitute in solutions of the homogeneous ODE}\hspace {3pt} \\ {} & {} & x \left (t \right )=\mathit {C1} \,{\mathrm e}^{-t}+\mathit {C2} \,{\mathrm e}^{t}+x_{p}\left (t \right ) \\ \square & {} & \textrm {Find a particular solution}\hspace {3pt} x_{p}\left (t \right )\hspace {3pt}\textrm {of the ODE}\hspace {3pt} \\ {} & \circ & \textrm {Use variation of parameters to find}\hspace {3pt} x_{p}\hspace {3pt}\textrm {here}\hspace {3pt} f \left (t \right )\hspace {3pt}\textrm {is the forcing function}\hspace {3pt} \\ {} & {} & \left [x_{p}\left (t \right )=-x_{1}\left (t \right ) \int \frac {x_{2}\left (t \right ) f \left (t \right )}{W \left (x_{1}\left (t \right ), x_{2}\left (t \right )\right )}d t +x_{2}\left (t \right ) \int \frac {x_{1}\left (t \right ) f \left (t \right )}{W \left (x_{1}\left (t \right ), x_{2}\left (t \right )\right )}d t , f \left (t \right )=t^{2}\right ] \\ {} & \circ & \textrm {Wronskian of solutions of the homogeneous equation}\hspace {3pt} \\ {} & {} & W \left (x_{1}\left (t \right ), x_{2}\left (t \right )\right )=\left [\begin {array}{cc} {\mathrm e}^{-t} & {\mathrm e}^{t} \\ -{\mathrm e}^{-t} & {\mathrm e}^{t} \end {array}\right ] \\ {} & \circ & \textrm {Compute Wronskian}\hspace {3pt} \\ {} & {} & W \left (x_{1}\left (t \right ), x_{2}\left (t \right )\right )=2 \\ {} & \circ & \textrm {Substitute functions into equation for}\hspace {3pt} x_{p}\left (t \right ) \\ {} & {} & x_{p}\left (t \right )=-\frac {{\mathrm e}^{-t} \int {\mathrm e}^{t} t^{2}d t}{2}+\frac {{\mathrm e}^{t} \int {\mathrm e}^{-t} t^{2}d t}{2} \\ {} & \circ & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & x_{p}\left (t \right )=-t^{2}-2 \\ \bullet & {} & \textrm {Substitute particular solution into general solution to ODE}\hspace {3pt} \\ {} & {} & x \left (t \right )=\mathit {C1} \,{\mathrm e}^{-t}+\mathit {C2} \,{\mathrm e}^{t}-t^{2}-2 \\ \square & {} & \textrm {Check validity of solution}\hspace {3pt} x \left (t \right )=\textit {\_C1} {\mathrm e}^{-t}+\textit {\_C2} {\mathrm e}^{t}-t^{2}-2 \\ {} & \circ & \textrm {Use initial condition}\hspace {3pt} x \left (0\right )=0 \\ {} & {} & 0=\textit {\_C1} +\textit {\_C2} -2 \\ {} & \circ & \textrm {Compute derivative of the solution}\hspace {3pt} \\ {} & {} & \frac {d}{d t}x \left (t \right )=-\textit {\_C1} \,{\mathrm e}^{-t}+\textit {\_C2} \,{\mathrm e}^{t}-2 t \\ {} & \circ & \textrm {Use the initial condition}\hspace {3pt} \left (\frac {d}{d t}x \left (t \right )\right )\bigg | {\mstack {}{_{\left \{t \hiderel {=}0\right \}}}}=1 \\ {} & {} & 1=-\textit {\_C1} +\textit {\_C2} \\ {} & \circ & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \hspace {3pt}\textrm {and}\hspace {3pt} \textit {\_C2} \\ {} & {} & \left \{\textit {\_C1} =\frac {1}{2}, \textit {\_C2} =\frac {3}{2}\right \} \\ {} & \circ & \textrm {Substitute constant values into general solution and simplify}\hspace {3pt} \\ {} & {} & x \left (t \right )=\frac {{\mathrm e}^{-t}}{2}+\frac {3 \,{\mathrm e}^{t}}{2}-t^{2}-2 \\ \bullet & {} & \textrm {Solution to the}\hspace {3pt} \hspace {3pt}\textrm {IVP}\hspace {3pt} \\ {} & {} & x \left (t \right )=\frac {{\mathrm e}^{-t}}{2}+\frac {3 \,{\mathrm e}^{t}}{2}-t^{2}-2 \end {array} \]