6.4 Practice Problems

These are the tutorial questions for this section, worked in full.

Problem 6.4.1. Verify that the given function is a solution. \[(a)\ y'+8y = 0;\ y = ce^{-8x}\hspace {1.5cm} (b)\ (y')^2 = 4y;\ y = 0,\ y = (x+c)^2\]

Show solution

Solution.

(a)

\(y' = -8ce^{-8x}\), so \(y'+8y = -8ce^{-8x} + 8ce^{-8x} = 0\) for every \(c\). The curves are exponential decays through \((0,c)\), steeper for larger \(\left |c\right |\).

(b)

For \(y = (x+c)^2\): \(y' = 2(x+c)\), so \((y')^2 = 4(x+c)^2 = 4y\). For \(y = 0\): both sides are \(0\).

The pair is worth noticing. \(y=0\) is a solution but is not \((x+c)^2\) for any \(c\), so it is a singular solution — an envelope of the family of parabolas rather than a member of it.

Problem 6.4.2. Solve by an appropriate method. \[(a)\ (x\ln x)y' = y\hspace {1.2cm}(b)\ y' = \frac {y+x}{x}\] \[(c)\ 2xy\,dx + \big (1+x^2\big )dy = 0\hspace {1.2cm} (d)\ y' - \frac {y}{x} = -\frac 52x^2y^3\]

Show solution

Solution.

(a) Separable

\[\frac {dy}{y} = \frac {dx}{x\ln x} \implies \ln \left |y\right | = \ln \left |\ln x\right | + c \implies y = C\ln x .\]

(b) Linear (also homogeneous)

Write \(y' - \dfrac {y}{x} = 1\). The integrating factor is \(e^{-\int dx/x} = \dfrac 1x\), so \[\frac {d}{dx}\Big (\frac yx\Big ) = \frac 1x \implies \frac yx = \ln \left |x\right | + C \implies y = x\big (\ln \left |x\right | + C\big ).\]

(c) Exact

\(M = 2xy\) and \(N = 1+x^2\) give \(M_y = 2x = N_x\), so it is exact. Then \(f = \displaystyle \int 2xy\,dx = x^2y + g(y)\) and \(f_y = x^2+g'(y) = 1+x^2\) forces \(g(y) = y\). Hence \[x^2y + y = C \implies y = \frac {C}{1+x^2}.\]

(d) Bernoulli, \(n=3\)

Put \(v = y^{-2}\), so \(v' = -2y^{-3}y'\). Dividing the equation by \(y^3\) and substituting, \[-\frac 12v' - \frac {v}{x} = -\frac 52x^2 \implies v' + \frac {2v}{x} = 5x^2 .\] The integrating factor is \(x^2\), so \(\big (x^2v\big )' = 5x^4\) and \(x^2v = x^5 + C\), giving \[y^{-2} = x^3 + \frac {C}{x^2} \qquad \text {or}\qquad y^2 = \frac {x^2}{x^5+C}.\]

Problem 6.4.3. Solve the initial value problems. \[(a)\ \sin x\cosh y - y'\cos x\sinh y = 0,\ y(0) = 0\] \[(b)\ x\frac {dy}{dx} + y = x^4y^3,\ y(1) = 1\] \[(c)\ 2y''+y'-y = 0,\ y(4) = e^2-e^{-4},\ y'(4) = \tfrac 12e^2+e^{-4}\]

Show solution

Solution.

(a)

Separating, \[\frac {\sinh y}{\cosh y}dy = \frac {\sin x}{\cos x}dx \implies \ln \cosh y = -\ln \cos x + c \implies \cosh y = C\sec x .\] The condition \(y(0) = 0\) gives \(\cosh 0 = 1 = C\sec 0 = C\), so \[\cosh y = \sec x, \qquad \text {that is}\qquad y = \cosh ^{-1}\big (\sec x\big ).\]

(b)

Dividing by \(x\) gives \(y' + \dfrac yx = x^3y^3\), a Bernoulli equation with \(n=3\). With \(v = y^{-2}\), \[v' - \frac {2v}{x} = -2x^3 .\] The integrating factor is \(x^{-2}\), so \(\big (vx^{-2}\big )' = -2x\) and \(vx^{-2} = -x^2 + C\), that is \(v = Cx^2 - x^4\). The condition \(y(1)=1\) gives \(v(1) = 1\), so \(C = 2\) and \[y^{-2} = 2x^2 - x^4 \implies y = \frac {1}{x\sqrt {2-x^2}} .\]

(c)

The auxiliary equation \(2m^2+m-1 = 0\) factors as \((2m-1)(m+1) = 0\), so \(m = \dfrac 12\) and \(m = -1\), giving \[y = Ae^{x/2} + Be^{-x} .\] Then \(y' = \dfrac A2e^{x/2} - Be^{-x}\), and at \(x=4\), \[Ae^2 + Be^{-4} = e^2 - e^{-4},\qquad \frac A2e^2 - Be^{-4} = \frac 12e^2 + e^{-4}.\] Adding gives \(\dfrac {3A}{2}e^2 = \dfrac 32e^2\), so \(A = 1\) and then \(B = -1\): \[y = e^{x/2} - e^{-x}.\]

Problem 6.4.4. Find an integrating factor and solve.

(a)
\(2\cos x\cos y\,dx - \sin x\sin y\,dy = 0\)
(b)
\(y' - y = e^{2x}\)
(c)
\(y' + y\tan x = \sin 2x\), \(y(0) = 1\)

Show solution

Solution.

(a)

\(M = 2\cos x\cos y\) and \(N = -\sin x\sin y\) give \(M_y = -2\cos x\sin y\) and \(N_x = -\cos x\sin y\), not equal. Testing, \[\frac {M_y-N_x}{N} = \frac {-\cos x\sin y}{-\sin x\sin y} = \cot x ,\] a function of \(x\) alone, so \(\mu = e^{\int \cot x\,dx} = \sin x\). Multiplying, \[2\sin x\cos x\cos y\,dx - \sin ^2x\sin y\,dy = 0 ,\] now exact with \(f = \sin ^2x\cos y\). Hence \[\sin ^2x\cos y = C .\]

(b)

Linear with integrating factor \(e^{-x}\): \[\big (ye^{-x}\big )' = e^{x} \implies ye^{-x} = e^x + C \implies y = e^{2x} + Ce^{x}.\]

(c)

The integrating factor is \(e^{\int \tan x\,dx} = \sec x\), so \[\big (y\sec x\big )' = \sec x\sin 2x = 2\sin x .\] Integrating, \(y\sec x = -2\cos x + C\), that is \(y = -2\cos ^2x + C\cos x\). The condition \(y(0)=1\) gives \(-2+C = 1\), so \(C=3\) and \[y = 3\cos x - 2\cos ^2 x = \cos x\big (3-2\cos x\big ).\]

Problem 6.4.5. Find the general solution. \[(a)\ y''-9y = 0\hspace {1cm}(b)\ y''+2y'+6y = 0\hspace {1cm} (c)\ 16y''-8y'+y = 0\]

Show solution

Solution.

(a)

\(m^2-9 = 0\) gives \(m = \pm 3\), distinct and real: \[y = Ae^{3x} + Be^{-3x}.\]

(b)

\(m^2+2m+6 = 0\) gives \(m = \dfrac {-2\pm \sqrt {4-24}}{2} = -1\pm i\sqrt 5\), so \[y = e^{-x}\Big (A\cos \sqrt 5\,x + B\sin \sqrt 5\,x\Big ).\]

(c)

\(16m^2-8m+1 = (4m-1)^2 = 0\) gives the repeated root \(m = \dfrac 14\), so \[y = \big (A+Bx\big )e^{x/4}.\]

Problem 6.4.6. Reduce to first order and solve. \[(a)\ yy'' = 3y'\hspace {0.6cm}(b)\ xy''+y' = (y')^2\hspace {0.6cm} (c)\ yy'' = 2(y')^2\hspace {0.6cm}(d)\ y''+(y')^3\cos y = 0\]

Show solution

Solution. When \(x\) is absent from the equation, set \(p = y'\) and treat \(p\) as a function of \(y\), so that \(y'' = p\dfrac {dp}{dy}\). When \(y\) is absent, set \(p = y'\) and keep \(x\).

(a)

\(y\) is present and \(x\) is not, so use \(p(y)\): \[yp\frac {dp}{dy} = 3p \implies y\frac {dp}{dy} = 3 \implies p = 3\ln \left |y\right | + C_1 ,\] having divided by \(p\); the discarded case \(p=0\) gives the constant solutions \(y = \) const. Then \[\frac {dy}{dx} = 3\ln \left |y\right |+C_1 \implies x = \int \frac {dy}{3\ln \left |y\right |+C_1} + C_2 ,\] which cannot be reduced further in elementary terms; the answer is implicit.

(b)

\(y\) is absent, so put \(p = y'\): \[xp' = p^2-p \implies \frac {dp}{p(p-1)} = \frac {dx}{x}.\] Partial fractions give \(\ln \left |\dfrac {p-1}{p}\right | = \ln \left |x\right | + c\), so \(1 - \dfrac 1p = C_1x\) and \(p = \dfrac {1}{1-C_1x}\). Integrating, \[y = -\frac {1}{C_1}\ln \left |1-C_1x\right | + C_2 .\]

(c)

Using \(p(y)\), \[yp\frac {dp}{dy} = 2p^2 \implies \frac {dp}{p} = \frac {2\,dy}{y} \implies p = C y^2 .\] Then \(\dfrac {dy}{y^2} = C\,dx\) gives \(-\dfrac 1y = Cx + D\), that is \[y = \frac {1}{a+bx}\] for constants \(a,b\). Substituting back confirms \(yy'' = 2(y')^2\).

(d)

Using \(p(y)\), \[p\frac {dp}{dy} + p^3\cos y = 0 \implies \frac {dp}{p^2} = -\cos y\,dy \implies \frac 1p = \sin y + C_1 .\] Since \(p = \dfrac {dy}{dx}\), this gives \(dx = \big (\sin y + C_1\big )dy\) and hence \[x = -\cos y + C_1y + C_2 ,\] again an implicit solution, with \(x\) expressed in terms of \(y\).

Problem 6.4.7. Determine whether each pair is linearly independent on the given interval. \[(a)\ e^x,\ e^{-x}\ \text {(any interval)}\hspace {1.5cm} (b)\ \ln x,\ \ln x^2\ (x>1)\]

Show solution

Solution.

(a)

\[W = \begin {vmatrix} e^x & e^{-x}\\ e^x & -e^{-x}\end {vmatrix} = -1 - 1 = -2 \neq 0 ,\] so they are linearly independent on every interval.

(b)

\(\ln x^2 = 2\ln x\), so the second is a constant multiple of the first and they are linearly dependent. The Wronskian confirms it: \[W = \begin {vmatrix} \ln x & 2\ln x\\ \frac 1x & \frac 2x\end {vmatrix} = \frac {2\ln x}{x} - \frac {2\ln x}{x} = 0 .\]

Problem 6.4.8. Show \(y_1\) solves the equation and find \(y_2\) making a basis. \[(a)\ y'' - \frac 1xy' + \frac {1}{x^2}y = 0,\ y_1 = x\hspace {1cm} (b)\ y'' + \frac 2xy' + y = 0,\ y_1 = \frac {\sin x}{x}\]

Show solution

Solution.

(a)

With \(y_1 = x\): \(y_1' = 1\), \(y_1'' = 0\), so \(0 - \dfrac 1x + \dfrac {x}{x^2} = 0\). It is a solution.

For the second, use reduction of order with \(y_2 = vx\). Then \(y_2' = v'x+v\) and \(y_2'' = v''x+2v'\), and substituting, \[v''x + 2v' - \frac 1x\big (v'x+v\big ) + \frac {vx}{x^2} = v''x + v' = 0 .\] So \(\dfrac {v''}{v'} = -\dfrac 1x\), giving \(v' = \dfrac {C}{x}\) and \(v = C\ln x\). Hence \(y_2 = x\ln x\), and \(\{x,\ x\ln x\}\) is a basis.

(b)

Substituting \(y_1 = \dfrac {\sin x}{x}\) verifies the equation. The second solution is \[y_2 = \frac {\cos x}{x},\] as substitution confirms. The pair is independent, since neither is a constant multiple of the other, so they form a basis.

Problem 6.4.9. Solve the boundary value problems. \[(a)\ y''+4y'+5y = 0;\ y\Big (\frac {\pi }{2}\Big ) = 14e^{-\pi },\ y\Big (\frac {3\pi }{2}\Big ) = -14e^{-3\pi }\] \[(b)\ y''+y'-2y = 0;\ y(0) = 0,\ y(1) = e - \frac {1}{e^2}\]

Show solution

Solution.

(a)

\(m^2+4m+5 = 0\) gives \(m = -2\pm i\), so \[y = e^{-2x}\big (A\cos x + B\sin x\big ).\] At \(x = \dfrac {\pi }{2}\): \(\cos = 0\), \(\sin = 1\), so \(Be^{-\pi } = 14e^{-\pi }\) and \(B = 14\). At \(x = \dfrac {3\pi }{2}\): \(\cos = 0\), \(\sin = -1\), so \(-Be^{-3\pi } = -14e^{-3\pi }\), consistent with \(B = 14\) and leaving \(A\) free.

The two conditions are not independent, so the problem has infinitely many solutions: \[y = e^{-2x}\big (A\cos x + 14\sin x\big ),\qquad A \text { arbitrary.}\] This is characteristic of boundary value problems, which unlike initial value problems may have no solution or many.

(b)

\(m^2+m-2 = 0\) gives \(m = 1, -2\), so \(y = Ae^{x} + Be^{-2x}\). Then \[y(0) = A+B = 0,\qquad y(1) = Ae + Be^{-2} = e - e^{-2}.\] From the first, \(B = -A\); substituting, \(A\big (e - e^{-2}\big ) = e - e^{-2}\), so \(A = 1\) and \(B = -1\): \[y = e^{x} - e^{-2x}.\]

Problem 6.4.10. Solve the Euler–Cauchy equations. \[(a)\ x^2y''-4xy'+6y = 0\hspace {0.8cm}(b)\ x^2y''-20y = 0 \hspace {0.8cm}(c)\ x^2y''-7xy'+16y = 0\]

Show solution

Solution. Try \(y = x^m\), for which \(x^2y'' = m(m-1)x^m\) and \(xy' = mx^m\). The auxiliary equation is then obtained by cancelling \(x^m\).

(a)

\(m(m-1)-4m+6 = m^2-5m+6 = 0\), so \(m = 2,3\) and \[y = Ax^2 + Bx^3 .\]

(b)

\(m(m-1)-20 = m^2-m-20 = 0\), so \(m = 5,-4\) and \[y = Ax^5 + \frac {B}{x^4}.\]

(c)

\(m(m-1)-7m+16 = m^2-8m+16 = (m-4)^2 = 0\), a repeated root. As with constant coefficients the second solution carries an extra factor, here \(\ln x\): \[y = x^4\big (A + B\ln x\big ).\]

Problem 6.4.11. Find a general solution by undetermined coefficients. \[(a)\ y''+y = -x-x^2\hspace {0.8cm}(b)\ y''-y = e^{x} \hspace {0.8cm}(c)\ y''-2y'+2y = 2e^{x}\cos x\]

Show solution

Solution.

(a)

\(y_c = A\cos x + B\sin x\). Try \(y_p = ax^2+bx+c\), so \(y_p'' = 2a\) and \[2a + ax^2+bx+c = -x^2-x .\] Matching gives \(a = -1\), \(b = -1\) and \(2a+c = 0\), so \(c = 2\). Hence \[y = A\cos x + B\sin x - x^2 - x + 2 .\]

(b)

\(y_c = Ae^{x}+Be^{-x}\). Since \(e^{x}\) is already in \(y_c\), try \(y_p = cxe^{x}\). Then \(y_p'' = c(x+2)e^x\) and \[c(x+2)e^x - cxe^x = 2ce^x = e^x \implies c = \frac 12 .\] Hence \[y = Ae^{x} + Be^{-x} + \frac {x}{2}e^{x}.\]

(c)

\(m^2-2m+2 = 0\) gives \(m = 1\pm i\), so \(y_c = e^{x}\big (A\cos x + B\sin x\big )\). The forcing term is already of this form, so multiply by \(x\) and try \(y_p = xe^{x}\big (a\cos x + b\sin x\big )\). Substituting and matching gives \(a = 0\), \(b = 1\), so \[y = e^{x}\big (A\cos x + B\sin x\big ) + xe^{x}\sin x .\]

Problem 6.4.12. Solve by variation of parameters. \[(a)\ \big (D^2-2D+1\big )y = x^{3/2}e^{x}\hspace {0.6cm} (b)\ \big (D^2+2D+1\big )y = e^{-x}\ln x\hspace {0.6cm} (c)\ \big (x^2D^2-4xD+6\big )y = \frac {1}{x^4}\]

Show solution

Solution.

(a)

\(y_c = \big (A+Bx\big )e^{x}\), so \(y_1 = e^x\), \(y_2 = xe^x\) and \[W = \begin {vmatrix} e^x & xe^x\\ e^x & (1+x)e^x\end {vmatrix} = e^{2x}.\] With \(F = x^{3/2}e^x\), \[u_1' = \frac {-y_2F}{W} = -x^{5/2},\qquad u_2' = \frac {y_1F}{W} = x^{3/2},\] so \(u_1 = -\dfrac {2}{7}x^{7/2}\) and \(u_2 = \dfrac {2}{5}x^{5/2}\). Hence \[y_p = \Big (-\frac 27 + \frac 25\Big )x^{7/2}e^x = \frac {4}{35}x^{7/2}e^{x},\] and \(y = \big (A+Bx\big )e^{x} + \dfrac {4}{35}x^{7/2}e^{x}\).

(b)

\(y_c = \big (A+Bx\big )e^{-x}\), \(W = e^{-2x}\), and with \(F = e^{-x}\ln x\), \[u_1' = -x\ln x,\qquad u_2' = \ln x ,\] giving \(u_1 = -\dfrac {x^2}{2}\ln x + \dfrac {x^2}{4}\) and \(u_2 = x\ln x - x\). Hence \[y_p = e^{-x}\Big [\frac {x^2}{2}\ln x - \frac {3x^2}{4}\Big ],\] and \(y = \big (A+Bx\big )e^{-x} + \dfrac {x^2}{2}\Big (\ln x - \dfrac 32\Big )e^{-x}\).

(c)

This is Euler–Cauchy on the left, with \(y_c = Ax^2+Bx^3\) from the question above. Writing it in standard form, \[y'' - \frac 4xy' + \frac {6}{x^2}y = \frac {1}{x^6},\] so \(F = x^{-6}\). With \(y_1 = x^2\), \(y_2 = x^3\) and \(W = x^4\), \[u_1' = -\frac {x^3\cdot x^{-6}}{x^4} = -x^{-7},\qquad u_2' = \frac {x^2\cdot x^{-6}}{x^4} = x^{-8},\] giving \(u_1 = \dfrac {1}{6}x^{-6}\) and \(u_2 = -\dfrac {1}{7}x^{-7}\). Hence \[y_p = \frac {x^2}{6x^6} - \frac {x^3}{7x^7} = \frac {1}{42x^4},\] and \(y = Ax^2+Bx^3+\dfrac {1}{42x^4}\).

Problem 6.4.13. Verify that \(y = e^{x}\) solves \((x-1)y''-xy'+y = 0\), and hence solve \((x-1)y''-xy'+y = 1\) by reduction of order.

Show solution

Solution.

Verification

With \(y = e^x\) all three derivatives are \(e^x\), so \[(x-1)e^x - xe^x + e^x = e^x\big [(x-1)-x+1\big ] = 0 .\]

A second homogeneous solution

Trying \(y = x\) gives \((x-1)(0) - x(1) + x = 0\), so \(y_2 = x\) is also a solution, and \(\{e^x, x\}\) is a basis since neither is a multiple of the other.

The non-homogeneous equation

A particular solution is easy to spot: \(y_p = 1\) gives \(0 - 0 + 1 = 1\). Hence \[y = Ae^{x} + Bx + 1 .\]

Problem 6.4.14. Show that \(x^2y''-xy'+y = \ln x\) reduces to \(\dfrac {d^2y}{dt^2} - 2\dfrac {dy}{dt} + y = t\) under \(t = \ln x\), and solve it.

Show solution

Solution.

The reduction

With \(t = \ln x\) we have \(\dfrac {dt}{dx} = \dfrac 1x\), so by the chain rule \[\frac {dy}{dx} = \frac 1x\frac {dy}{dt},\qquad \frac {d^2y}{dx^2} = \frac {1}{x^2}\Big (\frac {d^2y}{dt^2} - \frac {dy}{dt}\Big ).\] Substituting, \[x^2\cdot \frac {1}{x^2}\Big (\ddot y - \dot y\Big ) - x\cdot \frac 1x\dot y + y = \ddot y - 2\dot y + y = t ,\] as required — the variable coefficients disappear, which is the point of the substitution.

Solving

The auxiliary equation \(m^2-2m+1 = (m-1)^2 = 0\) has the repeated root \(1\), so \(y_c = \big (A+Bt\big )e^{t}\). For a particular integral try \(y_p = at+b\): \[-2a + at + b = t \implies a = 1,\ b = 2 .\] Hence \(y = \big (A+Bt\big )e^{t} + t + 2\), and returning to \(x\) with \(t = \ln x\) and \(e^t = x\), \[y = x\big (A + B\ln x\big ) + \ln x + 2 .\]

Problem 6.4.15. Use the power series method to solve \[(a)\ xy'-3y = 6\hspace {1cm}(b)\ y''-xy'+y = 0\hspace {1cm} (c)\ (x-3)y'-xy = 0\]

Show solution

Solution.

(a)

Put \(y = \sum a_nx^n\). Then \(xy' = \sum na_nx^n\), so \[\sum _{n=0}^{\infty }\big (n-3\big )a_nx^n = 6 .\] Matching the constant term, \(-3a_0 = 6\), so \(a_0 = -2\). For \(n\geq 1\), \((n-3)a_n = 0\), so \(a_n = 0\) except when \(n = 3\), where the coefficient vanishes and \(a_3\) is unconstrained. Hence \[y = -2 + a_3x^3 = Cx^3 - 2 .\]

(b)

With \(y = \sum a_nx^n\), \[\sum (n+2)(n+1)a_{n+2}x^n - \sum na_nx^n + \sum a_nx^n = 0 ,\] so \[a_{n+2} = \frac {(n-1)a_n}{(n+2)(n+1)} .\] Taking \(a_1 = 1\), \(a_0 = 0\) gives \(a_3 = 0\) and hence every later odd coefficient zero, leaving \(y = x\) — which indeed satisfies the equation, since \(0 - x + x = 0\). Taking \(a_0 = 1\), \(a_1 = 0\) gives \[a_2 = -\frac 12,\quad a_4 = -\frac {1}{24},\quad a_6 = -\frac {1}{240},\dots \] so the general solution is \[y = A\left (1 - \frac {x^2}{2} - \frac {x^4}{24} - \frac {x^6}{240} - \cdots \right ) + Bx .\]

(c)

With \(y = \sum a_nx^n\), comparing coefficients of \(x^n\) in \((x-3)y' = xy\) gives \[na_n - 3(n+1)a_{n+1} = a_{n-1} \implies a_{n+1} = \frac {na_n - a_{n-1}}{3(n+1)} .\] At \(n=0\) this reads \(-3a_1 = 0\), so \(a_1 = 0\). Taking \(a_0 = 1\), \[a_2 = -\frac 16,\quad a_3 = -\frac {1}{27},\quad a_4 = \frac {1}{216},\dots \] so \[y = 1 - \frac {x^2}{6} - \frac {x^3}{27} + \frac {x^4}{216} + \cdots \] The equation is also separable, giving the closed form \(y = C(x-3)^3e^{x}\); expanding that about \(x=0\) reproduces the series above, which is a useful check on the recurrence.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.