2.17 problem 17

2.17.1 Solving as second order linear constant coeff ode
2.17.2 Solving using Kovacic algorithm
2.17.3 Maple step by step solution

Internal problem ID [3258]
Internal file name [OUTPUT/2750_Sunday_June_05_2022_08_40_00_AM_3854497/index.tex]

Book: Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section: Chapter 4. Linear Differential Equations. Page 183
Problem number: 17.
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "kovacic", "second_order_linear_constant_coeff"

Maple gives the following as the ode type

[[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {y^{\prime \prime }+2 y^{\prime }+2 y=\cosh \left (x \right ) \sin \left (x \right )} \]

2.17.1 Solving as second order linear constant coeff ode

This is second order non-homogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = f(x) \] Where \(A=1, B=2, C=2, f(x)=\cosh \left (x \right ) \sin \left (x \right )\). Let the solution be \[ y = y_h + y_p \] Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the non-homogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to \[ y^{\prime \prime }+2 y^{\prime }+2 y = 0 \] This is second order with constant coefficients homogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = 0 \] Where in the above \(A=1, B=2, C=2\). Let the solution be \(y=e^{\lambda x}\). Substituting this into the ODE gives \[ \lambda ^{2} {\mathrm e}^{\lambda x}+2 \lambda \,{\mathrm e}^{\lambda x}+2 \,{\mathrm e}^{\lambda x} = 0 \tag {1} \] Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\) gives \[ \lambda ^{2}+2 \lambda +2 = 0 \tag {2} \] Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula \[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \] Substituting \(A=1, B=2, C=2\) into the above gives \begin {align*} \lambda _{1,2} &= \frac {-2}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {2^2 - (4) \left (1\right )\left (2\right )}\\ &= -1 \pm i \end {align*}

Hence \begin {align*} \lambda _1 &= -1 + i\\ \lambda _2 &= -1 - i \end {align*}

Which simplifies to \begin{align*} \lambda _1 &= -1+i \\ \lambda _2 &= -1-i \\ \end{align*} Since roots are complex conjugate of each others, then let the roots be \[ \lambda _{1,2} = \alpha \pm i \beta \] Where \(\alpha =-1\) and \(\beta =1\). Therefore the final solution, when using Euler relation, can be written as \[ y = e^{\alpha x} \left ( c_{1} \cos (\beta x) + c_{2} \sin (\beta x) \right ) \] Which becomes \[ y = e^{-x}\left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right ) \] Therefore the homogeneous solution \(y_h\) is \[ y_h = {\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right ) \] The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let \begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation} Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as \begin{align*} y_1 &= {\mathrm e}^{-x} \cos \left (x \right ) \\ y_2 &= {\mathrm e}^{-x} \sin \left (x \right ) \\ \end{align*} In the Variation of parameters \(u_1,u_2\) are found using \begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*} Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence \[ W = \begin {vmatrix} {\mathrm e}^{-x} \cos \left (x \right ) & {\mathrm e}^{-x} \sin \left (x \right ) \\ \frac {d}{dx}\left ({\mathrm e}^{-x} \cos \left (x \right )\right ) & \frac {d}{dx}\left ({\mathrm e}^{-x} \sin \left (x \right )\right ) \end {vmatrix} \] Which gives \[ W = \begin {vmatrix} {\mathrm e}^{-x} \cos \left (x \right ) & {\mathrm e}^{-x} \sin \left (x \right ) \\ -{\mathrm e}^{-x} \cos \left (x \right )-{\mathrm e}^{-x} \sin \left (x \right ) & -{\mathrm e}^{-x} \sin \left (x \right )+{\mathrm e}^{-x} \cos \left (x \right ) \end {vmatrix} \] Therefore \[ W = \left ({\mathrm e}^{-x} \cos \left (x \right )\right )\left (-{\mathrm e}^{-x} \sin \left (x \right )+{\mathrm e}^{-x} \cos \left (x \right )\right ) - \left ({\mathrm e}^{-x} \sin \left (x \right )\right )\left (-{\mathrm e}^{-x} \cos \left (x \right )-{\mathrm e}^{-x} \sin \left (x \right )\right ) \] Which simplifies to \[ W = {\mathrm e}^{-2 x} \cos \left (x \right )^{2}+{\mathrm e}^{-2 x} \sin \left (x \right )^{2} \] Which simplifies to \[ W = {\mathrm e}^{-2 x} \] Therefore Eq. (2) becomes \[ u_1 = -\int \frac {{\mathrm e}^{-x} \sin \left (x \right )^{2} \cosh \left (x \right )}{{\mathrm e}^{-2 x}}\,dx \] Which simplifies to \[ u_1 = - \int \cosh \left (x \right ) \sin \left (x \right )^{2} {\mathrm e}^{x}d x \] Hence \[ u_1 = -\frac {\left (2 \sin \left (x \right )-2 \cos \left (x \right )\right ) {\mathrm e}^{2 x} \sin \left (x \right )}{16}-\frac {{\mathrm e}^{2 x}}{16}+\frac {\sin \left (x \right ) \cos \left (x \right )}{4}-\frac {x}{4} \] And Eq. (3) becomes \[ u_2 = \int \frac {{\mathrm e}^{-x} \cos \left (x \right ) \cosh \left (x \right ) \sin \left (x \right )}{{\mathrm e}^{-2 x}}\,dx \] Which simplifies to \[ u_2 = \int \frac {\cosh \left (x \right ) \sin \left (2 x \right ) {\mathrm e}^{x}}{2}d x \] Hence \[ u_2 = \frac {{\mathrm e}^{2 x} \left (2 \sin \left (2 x \right )-2 \cos \left (2 x \right )\right )}{32}-\frac {\cos \left (x \right )^{2}}{4} \] Which simplifies to \begin{align*} u_1 &= \frac {\left (-2+\cos \left (2 x \right )+\sin \left (2 x \right )\right ) {\mathrm e}^{2 x}}{16}-\frac {x}{4}+\frac {\sin \left (2 x \right )}{8} \\ u_2 &= \frac {\left (-2 \cos \left (x \right )^{2}+2 \sin \left (x \right ) \cos \left (x \right )+1\right ) {\mathrm e}^{2 x}}{16}-\frac {\cos \left (x \right )^{2}}{4} \\ \end{align*} Therefore the particular solution, from equation (1) is \[ y_p(x) = \left (\frac {\left (-2+\cos \left (2 x \right )+\sin \left (2 x \right )\right ) {\mathrm e}^{2 x}}{16}-\frac {x}{4}+\frac {\sin \left (2 x \right )}{8}\right ) {\mathrm e}^{-x} \cos \left (x \right )+\left (\frac {\left (-2 \cos \left (x \right )^{2}+2 \sin \left (x \right ) \cos \left (x \right )+1\right ) {\mathrm e}^{2 x}}{16}-\frac {\cos \left (x \right )^{2}}{4}\right ) {\mathrm e}^{-x} \sin \left (x \right ) \] Which simplifies to \[ y_p(x) = -\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \] Therefore the general solution is \begin{align*} y &= y_h + y_p \\ &= \left ({\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right )\right ) + \left (-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16}\right ) \\ \end{align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= {\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right )-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \\ \end{align*}

Figure 139: Slope field plot

Verification of solutions

\[ y = {\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right )-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \] Verified OK.

2.17.2 Solving using Kovacic algorithm

Writing the ode as \begin {align*} y^{\prime \prime }+2 y^{\prime }+2 y &= 0 \tag {1} \\ A y^{\prime \prime } + B y^{\prime } + C y &= 0 \tag {2} \end {align*}

Comparing (1) and (2) shows that \begin {align*} A &= 1 \\ B &= 2\tag {3} \\ C &= 2 \end {align*}

Applying the Liouville transformation on the dependent variable gives \begin {align*} z(x) &= y e^{\int \frac {B}{2 A} \,dx} \end {align*}

Then (2) becomes \begin {align*} z''(x) = r z(x)\tag {4} \end {align*}

Where \(r\) is given by \begin {align*} r &= \frac {s}{t}\tag {5} \\ &= \frac {2 A B' - 2 B A' + B^2 - 4 A C}{4 A^2} \end {align*}

Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives \begin {align*} r &= \frac {-1}{1}\tag {6} \end {align*}

Comparing the above to (5) shows that \begin {align*} s &= -1\\ t &= 1 \end {align*}

Therefore eq. (4) becomes \begin {align*} z''(x) &= -z \left (x \right ) \tag {7} \end {align*}

Equation (7) is now solved. After finding \(z(x)\) then \(y\) is found using the inverse transformation \begin {align*} y &= z \left (x \right ) e^{-\int \frac {B}{2 A} \,dx} \end {align*}

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of \(r\) and the order of \(r\) at \(\infty \). The following table summarizes these cases.

Case

Allowed pole order for \(r\)

Allowed value for \(\mathcal {O}(\infty )\)

1

\(\left \{ 0,1,2,4,6,8,\cdots \right \} \)

\(\left \{ \cdots ,-6,-4,-2,0,2,3,4,5,6,\cdots \right \} \)

2

Need to have at least one pole that is either order \(2\) or odd order greater than \(2\). Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. \(\{1,2\}\),\(\{1,3\}\),\(\{2\}\),\(\{3\}\),\(\{3,4\}\),\(\{1,2,5\}\).

no condition

3

\(\left \{ 1,2\right \} \)

\(\left \{ 2,3,4,5,6,7,\cdots \right \} \)

Table 21: Necessary conditions for each Kovacic case

The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore \begin {align*} O\left (\infty \right ) &= \text {deg}(t) - \text {deg}(s) \\ &= 0 - 0 \\ &= 0 \end {align*}

There are no poles in \(r\). Therefore the set of poles \(\Gamma \) is empty. Since there is no odd order pole larger than \(2\) and the order at \(\infty \) is \(0\) then the necessary conditions for case one are met. Therefore \begin {align*} L &= [1] \end {align*}

Since \(r = -1\) is not a function of \(x\), then there is no need run Kovacic algorithm to obtain a solution for transformed ode \(z''=r z\) as one solution is \[ z_1(x) = \cos \left (x \right ) \] Using the above, the solution for the original ode can now be found. The first solution to the original ode in \(y\) is found from \begin{align*} y_1 &= z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \\ &= z_1 e^{ -\int \frac {1}{2} \frac {2}{1} \,dx} \\ &= z_1 e^{-x} \\ &= z_1 \left ({\mathrm e}^{-x}\right ) \\ \end{align*} Which simplifies to \[ y_1 = {\mathrm e}^{-x} \cos \left (x \right ) \] The second solution \(y_2\) to the original ode is found using reduction of order \[ y_2 = y_1 \int \frac { e^{\int -\frac {B}{A} \,dx}}{y_1^2} \,dx \] Substituting gives \begin{align*} y_2 &= y_1 \int \frac { e^{\int -\frac {2}{1} \,dx}}{\left (y_1\right )^2} \,dx \\ &= y_1 \int \frac { e^{-2 x}}{\left (y_1\right )^2} \,dx \\ &= y_1 \left (\tan \left (x \right )\right ) \\ \end{align*} Therefore the solution is

\begin{align*} y &= c_{1} y_1 + c_{2} y_2 \\ &= c_{1} \left ({\mathrm e}^{-x} \cos \left (x \right )\right ) + c_{2} \left ({\mathrm e}^{-x} \cos \left (x \right )\left (\tan \left (x \right )\right )\right ) \\ \end{align*} This is second order nonhomogeneous ODE. Let the solution be \[ y = y_h + y_p \] Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the nonhomogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to \[ y^{\prime \prime }+2 y^{\prime }+2 y = 0 \] The homogeneous solution is found using the Kovacic algorithm which results in \[ y_h = c_{1} {\mathrm e}^{-x} \cos \left (x \right )+c_{2} {\mathrm e}^{-x} \sin \left (x \right ) \] The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let \begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation} Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as \begin{align*} y_1 &= {\mathrm e}^{-x} \cos \left (x \right ) \\ y_2 &= {\mathrm e}^{-x} \sin \left (x \right ) \\ \end{align*} In the Variation of parameters \(u_1,u_2\) are found using \begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*} Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence \[ W = \begin {vmatrix} {\mathrm e}^{-x} \cos \left (x \right ) & {\mathrm e}^{-x} \sin \left (x \right ) \\ \frac {d}{dx}\left ({\mathrm e}^{-x} \cos \left (x \right )\right ) & \frac {d}{dx}\left ({\mathrm e}^{-x} \sin \left (x \right )\right ) \end {vmatrix} \] Which gives \[ W = \begin {vmatrix} {\mathrm e}^{-x} \cos \left (x \right ) & {\mathrm e}^{-x} \sin \left (x \right ) \\ -{\mathrm e}^{-x} \cos \left (x \right )-{\mathrm e}^{-x} \sin \left (x \right ) & -{\mathrm e}^{-x} \sin \left (x \right )+{\mathrm e}^{-x} \cos \left (x \right ) \end {vmatrix} \] Therefore \[ W = \left ({\mathrm e}^{-x} \cos \left (x \right )\right )\left (-{\mathrm e}^{-x} \sin \left (x \right )+{\mathrm e}^{-x} \cos \left (x \right )\right ) - \left ({\mathrm e}^{-x} \sin \left (x \right )\right )\left (-{\mathrm e}^{-x} \cos \left (x \right )-{\mathrm e}^{-x} \sin \left (x \right )\right ) \] Which simplifies to \[ W = {\mathrm e}^{-2 x} \cos \left (x \right )^{2}+{\mathrm e}^{-2 x} \sin \left (x \right )^{2} \] Which simplifies to \[ W = {\mathrm e}^{-2 x} \] Therefore Eq. (2) becomes \[ u_1 = -\int \frac {{\mathrm e}^{-x} \sin \left (x \right )^{2} \cosh \left (x \right )}{{\mathrm e}^{-2 x}}\,dx \] Which simplifies to \[ u_1 = - \int \cosh \left (x \right ) \sin \left (x \right )^{2} {\mathrm e}^{x}d x \] Hence \[ u_1 = -\frac {\left (2 \sin \left (x \right )-2 \cos \left (x \right )\right ) {\mathrm e}^{2 x} \sin \left (x \right )}{16}-\frac {{\mathrm e}^{2 x}}{16}+\frac {\sin \left (x \right ) \cos \left (x \right )}{4}-\frac {x}{4} \] And Eq. (3) becomes \[ u_2 = \int \frac {{\mathrm e}^{-x} \cos \left (x \right ) \cosh \left (x \right ) \sin \left (x \right )}{{\mathrm e}^{-2 x}}\,dx \] Which simplifies to \[ u_2 = \int \frac {\cosh \left (x \right ) \sin \left (2 x \right ) {\mathrm e}^{x}}{2}d x \] Hence \[ u_2 = \frac {{\mathrm e}^{2 x} \left (2 \sin \left (2 x \right )-2 \cos \left (2 x \right )\right )}{32}-\frac {\cos \left (x \right )^{2}}{4} \] Which simplifies to \begin{align*} u_1 &= \frac {\left (-2+\cos \left (2 x \right )+\sin \left (2 x \right )\right ) {\mathrm e}^{2 x}}{16}-\frac {x}{4}+\frac {\sin \left (2 x \right )}{8} \\ u_2 &= \frac {\left (-2 \cos \left (x \right )^{2}+2 \sin \left (x \right ) \cos \left (x \right )+1\right ) {\mathrm e}^{2 x}}{16}-\frac {\cos \left (x \right )^{2}}{4} \\ \end{align*} Therefore the particular solution, from equation (1) is \[ y_p(x) = \left (\frac {\left (-2+\cos \left (2 x \right )+\sin \left (2 x \right )\right ) {\mathrm e}^{2 x}}{16}-\frac {x}{4}+\frac {\sin \left (2 x \right )}{8}\right ) {\mathrm e}^{-x} \cos \left (x \right )+\left (\frac {\left (-2 \cos \left (x \right )^{2}+2 \sin \left (x \right ) \cos \left (x \right )+1\right ) {\mathrm e}^{2 x}}{16}-\frac {\cos \left (x \right )^{2}}{4}\right ) {\mathrm e}^{-x} \sin \left (x \right ) \] Which simplifies to \[ y_p(x) = -\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \] Therefore the general solution is \begin{align*} y &= y_h + y_p \\ &= \left (c_{1} {\mathrm e}^{-x} \cos \left (x \right )+c_{2} {\mathrm e}^{-x} \sin \left (x \right )\right ) + \left (-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16}\right ) \\ \end{align*} Which simplifies to \[ y = {\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right )-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= {\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right )-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \\ \end{align*}

Figure 140: Slope field plot

Verification of solutions

\[ y = {\mathrm e}^{-x} \left (c_{1} \cos \left (x \right )+c_{2} \sin \left (x \right )\right )-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \] Verified OK.

2.17.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y^{\prime }+2 y^{\prime }+2 y=\cosh \left (x \right ) \sin \left (x \right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d}{d x}y^{\prime } \\ \bullet & {} & \textrm {Characteristic polynomial of homogeneous ODE}\hspace {3pt} \\ {} & {} & r^{2}+2 r +2=0 \\ \bullet & {} & \textrm {Use quadratic formula to solve for}\hspace {3pt} r \\ {} & {} & r =\frac {\left (-2\right )\pm \left (\sqrt {-4}\right )}{2} \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (-1-\mathrm {I}, -1+\mathrm {I}\right ) \\ \bullet & {} & \textrm {1st solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (x \right )={\mathrm e}^{-x} \cos \left (x \right ) \\ \bullet & {} & \textrm {2nd solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (x \right )={\mathrm e}^{-x} \sin \left (x \right ) \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & y=c_{1} y_{1}\left (x \right )+c_{2} y_{2}\left (x \right )+y_{p}\left (x \right ) \\ \bullet & {} & \textrm {Substitute in solutions of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y=c_{1} {\mathrm e}^{-x} \cos \left (x \right )+c_{2} {\mathrm e}^{-x} \sin \left (x \right )+y_{p}\left (x \right ) \\ \square & {} & \textrm {Find a particular solution}\hspace {3pt} y_{p}\left (x \right )\hspace {3pt}\textrm {of the ODE}\hspace {3pt} \\ {} & \circ & \textrm {Use variation of parameters to find}\hspace {3pt} y_{p}\hspace {3pt}\textrm {here}\hspace {3pt} f \left (x \right )\hspace {3pt}\textrm {is the forcing function}\hspace {3pt} \\ {} & {} & \left [y_{p}\left (x \right )=-y_{1}\left (x \right ) \left (\int \frac {y_{2}\left (x \right ) f \left (x \right )}{W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )}d x \right )+y_{2}\left (x \right ) \left (\int \frac {y_{1}\left (x \right ) f \left (x \right )}{W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )}d x \right ), f \left (x \right )=\cosh \left (x \right ) \sin \left (x \right )\right ] \\ {} & \circ & \textrm {Wronskian of solutions of the homogeneous equation}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )=\left [\begin {array}{cc} {\mathrm e}^{-x} \cos \left (x \right ) & {\mathrm e}^{-x} \sin \left (x \right ) \\ -{\mathrm e}^{-x} \cos \left (x \right )-{\mathrm e}^{-x} \sin \left (x \right ) & -{\mathrm e}^{-x} \sin \left (x \right )+{\mathrm e}^{-x} \cos \left (x \right ) \end {array}\right ] \\ {} & \circ & \textrm {Compute Wronskian}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )={\mathrm e}^{-2 x} \\ {} & \circ & \textrm {Substitute functions into equation for}\hspace {3pt} y_{p}\left (x \right ) \\ {} & {} & y_{p}\left (x \right )=-{\mathrm e}^{-x} \left (\cos \left (x \right ) \left (\int \cosh \left (x \right ) \sin \left (x \right )^{2} {\mathrm e}^{x}d x \right )-\frac {\sin \left (x \right ) \left (\int \cosh \left (x \right ) \sin \left (2 x \right ) {\mathrm e}^{x}d x \right )}{2}\right ) \\ {} & \circ & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y_{p}\left (x \right )=-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \\ \bullet & {} & \textrm {Substitute particular solution into general solution to ODE}\hspace {3pt} \\ {} & {} & y=c_{1} {\mathrm e}^{-x} \cos \left (x \right )+c_{2} {\mathrm e}^{-x} \sin \left (x \right )-\frac {{\mathrm e}^{-x} \cos \left (x \right ) x}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \end {array} \]

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`
 

Solution by Maple

Time used: 0.0 (sec). Leaf size: 38

dsolve(diff(y(x),x$2)+2*diff(y(x),x)+2*y(x)=cosh(x)*sin(x),y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {\left (\left (-x +4 c_{1} \right ) \cos \left (x \right )+4 \sin \left (x \right ) c_{2} \right ) {\mathrm e}^{-x}}{4}-\frac {{\mathrm e}^{x} \left (-\sin \left (x \right )+\cos \left (x \right )\right )}{16} \]

Solution by Mathematica

Time used: 0.199 (sec). Leaf size: 47

DSolve[y''[x]+2*y'[x]+2*y[x]==Cosh[x]*Sin[x],y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \frac {1}{16} e^{-x} \left (\left (e^{2 x}+2+16 c_1\right ) \sin (x)-\left (e^{2 x}+4 (x-4 c_2)\right ) \cos (x)\right ) \]