38.3.22 problem 30

Internal problem ID [8289]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 1. Introduction to differential equations. Review problems at page 34
Problem number : 30
Date solved : Tuesday, September 30, 2025 at 05:21:44 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&={\mathrm e}^{x^{2}} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 55
ode:=diff(diff(y(x),x),x)+y(x) = exp(x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\sqrt {\pi }\, {\mathrm e}^{\frac {1}{4}} \left (i \sin \left (x \right )-\cos \left (x \right )\right ) \operatorname {erf}\left (i x -\frac {1}{2}\right )}{4}-\frac {\left (i \sin \left (x \right )+\cos \left (x \right )\right ) \sqrt {\pi }\, {\mathrm e}^{\frac {1}{4}} \operatorname {erf}\left (i x +\frac {1}{2}\right )}{4}+\cos \left (x \right ) c_1 +\sin \left (x \right ) c_2 \]
Mathematica. Time used: 0.044 (sec). Leaf size: 57
ode=D[y[x],{x,2}]+y[x]==Exp[x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \cos (x) \int _1^x-e^{K[1]^2} \sin (K[1])dK[1]+\sin (x) \int _1^xe^{K[2]^2} \cos (K[2])dK[2]+c_1 \cos (x)+c_2 \sin (x) \end{align*}
Sympy. Time used: 2.455 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(x**2) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - \int e^{x^{2}} \sin {\left (x \right )}\, dx\right ) \cos {\left (x \right )} + \left (C_{2} + \int e^{x^{2}} \cos {\left (x \right )}\, dx\right ) \sin {\left (x \right )} \]