Skip to content

Differential Equations: Problems & Exercises with solutions

Type
Practice problems
Problems
21
Levels
Easy · Medium · Hard

This page collects carefully crafted differential equations problems organized by topic and difficulty. Whether you are studying separable equations, first-order linear ODEs, initial value problems, second-order homogeneous equations, characteristic equations, undetermined coefficients, or variation of parameters, each section below follows a pedagogical progression from easy to hard, with hints and full step-by-step solutions.

Contents6 sections

Separable Differential Equations

A differential equation is separable if it can be written in the form dydx=f(x) g(y) \frac{dy}{dx} = f(x)\,g(y) . The technique requires isolating all yy-terms on one side and all xx-terms on the other, then integrating both sides. These problems form the foundation of first-order ODE methods and appear consistently on calculus and differential equations examinations.

Problem 1: Basic Separation of Variables

Easy

Consider the differential equation dydx=3x2y \dfrac{dy}{dx} = 3x^2 y .

  1. Find the general solution by separating variables.
  2. Find the particular solution satisfying y(0)=2 y(0) = 2 .
Hint
Divide both sides by yy (assuming y≠0y \neq 0) and multiply both sides by dxdx. You will then be able to integrate ∫1y dy\int \frac{1}{y}\,dy on the left and ∫3x2 dx\int 3x^2\,dx on the right. For part 2, substitute the initial condition into the general solution to solve for the constant CC.
View Solution
Solution to question 1:

Separate variables:

1y dy=3x2 dx \frac{1}{y}\,dy = 3x^2\,dx

Integrate both sides:

ln⁡∣y∣=x3+C1 \ln|y| = x^3 + C_1

Exponentiate both sides:

y=Cex3,C∈R,  C≠0 y = Ce^{x^3}, \quad C \in \mathbb{R},\; C \neq 0 Solution to question 2:

Apply y(0)=2 y(0) = 2 :

2=Ce0  ⟹  C=2 2 = Ce^{0} \implies C = 2 y=2ex3 \boxed{y = 2e^{x^3}}

Problem 2: Separation with a Trigonometric Right-Hand Side

Easy

Consider the differential equation dydx=cos⁡x⋅e−y \dfrac{dy}{dx} = \cos x \cdot e^{-y} .

  1. Find the general implicit solution.
  2. Solve explicitly for yy and apply the initial condition y(0)=0 y(0) = 0 .
Hint
Multiply both sides by eye^{y} to collect all yy-terms on the left. The right side becomes cos⁡x dx\cos x\,dx. Integrate both sides and then isolate yy using the natural logarithm.
View Solution
Solution to question 1:

Rewrite as ey dy=cos⁡x dx e^{y}\,dy = \cos x\,dx and integrate:

ey=sin⁡x+C e^{y} = \sin x + C Solution to question 2:

Take the natural log to solve explicitly:

y=ln⁡(sin⁡x+C) y = \ln(\sin x + C)

Apply y(0)=0 y(0) = 0 : ln⁡(0+C)=0  ⟹  C=1\ln(0 + C) = 0 \implies C = 1.

y=ln⁡(sin⁡x+1) \boxed{y = \ln(\sin x + 1)}

Problem 3: Rational Separable Equation with an Initial Value

Medium

Consider the differential equation (1+x2) dydx=x y2 (1 + x^2)\,\dfrac{dy}{dx} = x\,y^2 with initial condition y(0)=1 y(0) = 1 .

  1. Separate variables and find the general solution.
  2. Apply the initial condition and determine the interval of validity of the solution.
Hint
Divide both sides by y2(1+x2)y^2(1+x^2). On the xx-side you will need to integrate ∫x1+x2 dx\int \frac{x}{1+x^2}\,dx; consider the substitution u=1+x2u = 1 + x^2. To find the interval of validity, determine where the particular solution is defined and continuous.
View Solution
Solution to question 1:

Separate:

dyy2=x dx1+x2 \frac{dy}{y^2} = \frac{x\,dx}{1+x^2}

Integrate both sides:

−1y=12ln⁡(1+x2)+C -\frac{1}{y} = \frac{1}{2}\ln(1+x^2) + C

General solution (implicit):

y=−112ln⁡(1+x2)+C y = \frac{-1}{\tfrac{1}{2}\ln(1+x^2) + C} Solution to question 2:

Apply y(0)=1y(0) = 1: −1=C-1 = C, so C=−1C = -1.

y=11−12ln⁡(1+x2) y = \frac{1}{1 - \tfrac{1}{2}\ln(1+x^2)}

The solution is valid as long as the denominator is nonzero: ln⁡(1+x2)≠2\ln(1+x^2) \neq 2, i.e., x2≠e2−1x^2 \neq e^2 - 1. The interval of validity containing x=0x = 0 is:

−e2−1<x<e2−1 \boxed{-\sqrt{e^2 - 1} < x < \sqrt{e^2-1}}

Problem 4: Bernoulli-Type Separable Equation

Hard

Consider the equation dydx=y2−1x2−1 \dfrac{dy}{dx} = \dfrac{y^2 - 1}{x^2 - 1} for x>1x > 1, y>1y > 1.

  1. Use partial fractions on both sides to find the general solution in implicit form.
  2. Verify that y=xy = x is a particular solution and comment on how it fits into the general family.
Hint
After separating, you will integrate ∫dyy2−1\int \frac{dy}{y^2-1} and ∫dxx2−1\int \frac{dx}{x^2-1}. Both require the same partial fraction decomposition: 1t2−1=12(1t−1−1t+1)\frac{1}{t^2-1} = \frac{1}{2}\left(\frac{1}{t-1} - \frac{1}{t+1}\right). Simplify using logarithm rules after integrating.
View Solution
Solution to question 1:

Separate: dyy2−1=dxx2−1\dfrac{dy}{y^2-1} = \dfrac{dx}{x^2-1}. Apply partial fractions to each side:

12ln⁡∣y−1y+1∣=12ln⁡∣x−1x+1∣+C1 \frac{1}{2}\ln\left|\frac{y-1}{y+1}\right| = \frac{1}{2}\ln\left|\frac{x-1}{x+1}\right| + C_1

Multiply by 2 and exponentiate:

y−1y+1=K x−1x+1,K>0 \frac{y-1}{y+1} = K\,\frac{x-1}{x+1}, \quad K > 0 Solution to question 2:

If y=xy = x, then y−1y+1=x−1x+1\dfrac{y-1}{y+1} = \dfrac{x-1}{x+1}, so K=1K = 1. This is indeed a member of the general family. Direct substitution confirms dydx=1=x2−1x2−1=1\dfrac{dy}{dx} = 1 = \dfrac{x^2-1}{x^2-1} = 1. ✓\checkmark

First-Order Linear Differential Equations and Integrating Factors

A first-order linear ODE has the standard form dydx+P(x) y=Q(x) \dfrac{dy}{dx} + P(x)\,y = Q(x) . The key technique is to multiply through by the integrating factor μ(x)=e∫P(x) dx \mu(x) = e^{\int P(x)\,dx} , which transforms the left side into an exact derivative. These equations model phenomena such as mixing problems, Newton’s law of cooling, and population growth with harvesting.

Problem 5: Standard Integrating Factor

Easy

Solve the differential equation dydx+2x y=x3 \dfrac{dy}{dx} + \dfrac{2}{x}\,y = x^3 for x>0x > 0.

  1. Identify P(x)P(x) and compute the integrating factor μ(x)\mu(x).
  2. Find the general solution.
Hint
With P(x)=2/xP(x) = 2/x, the integrating factor is μ=e∫(2/x) dx=x2\mu = e^{\int (2/x)\,dx} = x^2. Multiply the entire equation by x2x^2 and recognize the left side as ddx[x2y]\dfrac{d}{dx}[x^2 y].
View Solution
Solution to question 1:

P(x)=2xP(x) = \dfrac{2}{x}, so μ(x)=e2ln⁡x=x2\mu(x) = e^{2\ln x} = x^2.

Solution to question 2:

Multiply through:

ddx ⁣[x2y]=x5 \frac{d}{dx}\!\left[x^2 y\right] = x^5

Integrate both sides:

x2y=x66+C x^2 y = \frac{x^6}{6} + C y=x46+Cx2 \boxed{y = \frac{x^4}{6} + \frac{C}{x^2}}

Problem 6: Initial Value Problem with Exponential Forcing

Easy

Solve the initial value problem y′−3y=e5x,y(0)=1 y^{\prime} - 3y = e^{5x}, \quad y(0) = 1 .

  1. Find the general solution using an integrating factor.
  2. Apply the initial condition to find the particular solution.
Hint
Here P(x)=−3P(x) = -3, so μ=e−3x\mu = e^{-3x}. After multiplying through, the right side becomes e5x⋅e−3x=e2xe^{5x} \cdot e^{-3x} = e^{2x}, which integrates easily.
View Solution
Solution to question 1:

Multiply by e−3xe^{-3x}:

ddx ⁣[e−3xy]=e2x \frac{d}{dx}\!\left[e^{-3x}y\right] = e^{2x}

Integrate:

e−3xy=e2x2+C  ⟹  y=e5x2+Ce3x e^{-3x}y = \frac{e^{2x}}{2} + C \implies y = \frac{e^{5x}}{2} + Ce^{3x} Solution to question 2:

At x=0x=0: 1=12+C  ⟹  C=121 = \tfrac{1}{2} + C \implies C = \tfrac{1}{2}.

y=e5x+e3x2 \boxed{y = \frac{e^{5x} + e^{3x}}{2}}

Problem 7: Mixing Tank Problem

Medium

A tank initially contains 100 L of pure water. A salt solution with concentration 0.5 kg/L flows in at 4 L/min, and the well-mixed solution drains out at the same rate.

  1. Set up the differential equation for Q(t)Q(t), the amount of salt (in kg) in the tank at time tt (in minutes).
  2. Solve the IVP and find the limiting amount of salt in the tank as t→∞t \to \infty.
Hint
Rate in = (concentration in) × (flow rate in). Rate out = (concentration out) × (flow rate out), where concentration out = Q(t)/100Q(t)/100. Write Q′=rate in−rate outQ^{\prime} = \text{rate in} - \text{rate out} and bring it to standard linear form.
View Solution
Solution to question 1: Q′=(0.5)(4)−Q100(4)=2−Q25 Q^{\prime} = (0.5)(4) - \frac{Q}{100}(4) = 2 - \frac{Q}{25}

Standard form: Q′+Q25=2 Q^{\prime} + \dfrac{Q}{25} = 2 , Q(0)=0Q(0) = 0.

Solution to question 2:

Integrating factor μ=et/25\mu = e^{t/25}:

ddt ⁣[et/25Q]=2et/25 \frac{d}{dt}\!\left[e^{t/25}Q\right] = 2e^{t/25} Q=50+Ce−t/25 Q = 50 + Ce^{-t/25}

Apply Q(0)=0Q(0)=0: C=−50C = -50.

Q(t)=50 ⁣(1−e−t/25) \boxed{Q(t) = 50\!\left(1 - e^{-t/25}\right)}

As t→∞t \to \infty, Q→50Q \to 50 kg, which equals the steady-state: 100 L ×\times 0.5 kg/L.

Problem 8: Bernoulli Equation

Hard

Solve the Bernoulli equation dydx+yx=x2y3 \dfrac{dy}{dx} + \dfrac{y}{x} = x^2 y^3 .

  1. Apply the substitution v=y1−3=y−2 v = y^{1-3} = y^{-2} to reduce the equation to a linear ODE in vv.
  2. Solve for v(x)v(x), then recover y(x)y(x).
Hint
Divide the equation by y3y^3 first, so you have y−3y′+y−2x=x2y^{-3}y^{\prime} + \frac{y^{-2}}{x} = x^2. Then set v=y−2v = y^{-2} and compute v′=−2y−3y′v^{\prime} = -2y^{-3}y^{\prime}. Substituting converts the equation into a first-order linear ODE in vv that you can solve with an integrating factor.
View Solution
Solution to question 1:

Divide by y3y^3:

y−3y′+y−2x=x2 y^{-3}y^{\prime} + \frac{y^{-2}}{x} = x^2

Let v=y−2v = y^{-2}, so v′=−2y−3y′v^{\prime} = -2y^{-3}y^{\prime}, giving y−3y′=−v′/2y^{-3}y^{\prime} = -v^{\prime}/2:

−v′2+vx=x2  ⟹  v′−2vx=−2x2 -\frac{v^{\prime}}{2} + \frac{v}{x} = x^2 \implies v^{\prime} - \frac{2v}{x} = -2x^2 Solution to question 2:

Integrating factor: μ=x−2\mu = x^{-2}. Then:

ddx ⁣[vx2]=−2  ⟹  vx2=−2x+C \frac{d}{dx}\!\left[\frac{v}{x^2}\right] = -2 \implies \frac{v}{x^2} = -2x + C v=−2x3+Cx2 v = -2x^3 + Cx^2

Recover yy from v=y−2v = y^{-2}:

y=1Cx2−2x3 \boxed{y = \frac{1}{\sqrt{Cx^2 - 2x^3}}}

Second-Order Homogeneous Linear Differential Equations

A second-order homogeneous linear ODE with constant coefficients has the form ay′′+by′+cy=0 ay^{\prime\prime} + by^{\prime} + cy = 0 . Its general solution is built from the roots of the characteristic equation ar2+br+c=0 ar^2 + br + c = 0 . The nature of those roots, distinct real, repeated real, or complex conjugate,determines the form of the general solution. Mastering these three cases is essential before moving to nonhomogeneous equations.

Problem 9: Distinct Real Roots

Easy

Solve the differential equation y′′−5y′+6y=0 y^{\prime\prime} - 5y^{\prime} + 6y = 0 .

  1. Write and solve the characteristic equation.
  2. State the general solution and find the particular solution with y(0)=2 y(0) = 2 , y′(0)=5 y^{\prime}(0) = 5 .
Hint
Substitute y=erxy = e^{rx} and factor the resulting quadratic. With two distinct real roots r1r_1 and r2r_2, the general solution is y=c1er1x+c2er2xy = c_1 e^{r_1 x} + c_2 e^{r_2 x}. Differentiate once to use both initial conditions.
View Solution
Solution to question 1:

Characteristic equation: r2−5r+6=(r−2)(r−3)=0r^2 - 5r + 6 = (r-2)(r-3) = 0, so r1=2,  r2=3r_1 = 2,\; r_2 = 3.

Solution to question 2: y=c1e2x+c2e3x,y′=2c1e2x+3c2e3x y = c_1 e^{2x} + c_2 e^{3x}, \quad y^{\prime} = 2c_1 e^{2x} + 3c_2 e^{3x}

At x=0x=0: c1+c2=2c_1 + c_2 = 2 and 2c1+3c2=52c_1 + 3c_2 = 5. Solving: c1=1,  c2=1c_1 = 1,\; c_2 = 1.

y=e2x+e3x \boxed{y = e^{2x} + e^{3x}}

Problem 10: Repeated Root Case

Easy

Solve the IVP y′′+4y′+4y=0,y(0)=3,y′(0)=−1 y^{\prime\prime} + 4y^{\prime} + 4y = 0, \quad y(0) = 3, \quad y^{\prime}(0) = -1 .

  1. Find the repeated root and write the general solution.
  2. Apply the initial conditions.
Hint
The characteristic equation factors as a perfect square. When the characteristic equation yields a repeated root r=αr = \alpha, the two linearly independent solutions are eαxe^{\alpha x} and xeαxx e^{\alpha x}.
View Solution
Solution to question 1:

Characteristic equation: r2+4r+4=(r+2)2=0r^2 + 4r + 4 = (r+2)^2 = 0, so r=−2r = -2 (repeated).

y=(c1+c2x)e−2x y = (c_1 + c_2 x)e^{-2x} Solution to question 2:

Differentiate: y′=c2e−2x−2(c1+c2x)e−2xy^{\prime} = c_2 e^{-2x} - 2(c_1 + c_2 x)e^{-2x}.

At x=0x = 0: c1=3c_1 = 3 and c2−2c1=−1  ⟹  c2=5c_2 - 2c_1 = -1 \implies c_2 = 5.

y=(3+5x)e−2x \boxed{y = (3 + 5x)e^{-2x}}

Problem 11: Complex Conjugate Roots

Medium

Solve the IVP y′′−2y′+5y=0,y(0)=0,y′(0)=4 y^{\prime\prime} - 2y^{\prime} + 5y = 0, \quad y(0) = 0, \quad y^{\prime}(0) = 4 .

  1. Find the complex roots and write the general real-valued solution using sine and cosine.
  2. Apply the initial conditions to determine the particular solution.
Hint
The discriminant is negative, so the roots are complex: r=α±βir = \alpha \pm \beta i. Use Euler’s formula to write the general solution as y=eαx(c1cos⁡βx+c2sin⁡βx)y = e^{\alpha x}(c_1 \cos \beta x + c_2 \sin \beta x).
View Solution
Solution to question 1:

Characteristic equation: r2−2r+5=0r^2 - 2r + 5 = 0. Discriminant: 4−20=−164 - 20 = -16.

r=2±4i2=1±2i r = \frac{2 \pm 4i}{2} = 1 \pm 2i y=ex(c1cos⁡2x+c2sin⁡2x) y = e^{x}(c_1 \cos 2x + c_2 \sin 2x) Solution to question 2:

At x=0x = 0: y(0)=c1=0y(0) = c_1 = 0.

Differentiate with c1=0c_1 = 0: y′=ex(c2sin⁡2x)⋅1+ex(2c2cos⁡2x)y^{\prime} = e^x(c_2 \sin 2x) \cdot 1 + e^x(2c_2\cos 2x). At x=0x=0: y′(0)=2c2=4  ⟹  c2=2y^{\prime}(0) = 2c_2 = 4 \implies c_2 = 2.

y=2exsin⁡2x \boxed{y = 2e^{x}\sin 2x}

Problem 12: Constructing an Equation from Known Solutions

Medium

Two functions are given: y1=e−xcos⁡3x y_1 = e^{-x}\cos 3x and y2=e−xsin⁡3x y_2 = e^{-x}\sin 3x .

  1. Identify the complex roots from which these solutions arise and reconstruct the characteristic equation.
  2. Write the second-order homogeneous ODE with constant coefficients having these as a fundamental set of solutions, and compute the Wronskian W(y1,y2)W(y_1, y_2).
Hint
From eαxcos⁡βxe^{\alpha x}\cos\beta x and eαxsin⁡βxe^{\alpha x}\sin\beta x, read off α=−1\alpha = -1 and β=3\beta = 3. The roots are r=−1±3ir = -1 \pm 3i. Reconstruct the characteristic polynomial as (r−(−1+3i))(r−(−1−3i))(r - (-1+3i))(r - (-1-3i)). For the Wronskian, use W=y1y2′−y2y1′W = y_1 y_2^{\prime} - y_2 y_1^{\prime}.
View Solution
Solution to question 1:

Roots: r=−1±3ir = -1 \pm 3i. Characteristic polynomial:

(r+1)2+9=r2+2r+10=0 (r+1)^2 + 9 = r^2 + 2r + 10 = 0 Solution to question 2:

The ODE is y′′+2y′+10y=0 y^{\prime\prime} + 2y^{\prime} + 10y = 0 .

Wronskian:

W=y1y2′−y2y1′ W = y_1 y_2^{\prime} - y_2 y_1^{\prime}

By Abel’s theorem, W(x)=W(0) e−∫0x2 dt=W(0) e−2xW(x) = W(0)\,e^{-\int_0^x 2\,dt} = W(0)\,e^{-2x}. Computing W(0)=(1)(3)−(0)(−1)=3W(0) = (1)(3) - (0)(-1) = 3:

W(y1,y2)=3e−2x≠0 \boxed{W(y_1, y_2) = 3e^{-2x} \neq 0}

Since W≠0W \neq 0, the set {y1,y2}\{y_1, y_2\} is indeed a fundamental set of solutions.

Nonhomogeneous Equations: Method of Undetermined Coefficients

When the right-hand side of ay′′+by′+cy=f(x) ay^{\prime\prime} + by^{\prime} + cy = f(x) consists of polynomials, exponentials, sines, cosines, or their products, the method of undetermined coefficients offers an efficient path to finding a particular solution ypy_p. The general solution is then y=yh+ypy = y_h + y_p, where yhy_h is the homogeneous solution. The key step is recognizing when the trial function overlaps with part of yhy_h, requiring multiplication by xx to avoid redundancy.

Problem 13: Polynomial Forcing Function

Easy

Find the general solution of y′′+3y′+2y=4x+1 y^{\prime\prime} + 3y^{\prime} + 2y = 4x + 1 .

  1. Solve the associated homogeneous equation.
  2. Guess a particular solution of the form yp=Ax+B y_p = Ax + B and determine AA and BB.
Hint
For a polynomial forcing term of degree 1, guess yp=Ax+By_p = Ax + B. Substitute ypy_p, yp′y_p^{\prime}, and yp′′y_p^{\prime\prime} into the ODE and match coefficients of equal powers of xx on both sides.
View Solution
Solution to question 1:

Characteristic equation: r2+3r+2=(r+1)(r+2)=0r^2 + 3r + 2 = (r+1)(r+2) = 0, so r=−1,−2r = -1, -2.

yh=c1e−x+c2e−2x y_h = c_1 e^{-x} + c_2 e^{-2x} Solution to question 2:

With yp=Ax+By_p = Ax + B, we have yp′=Ay_p^{\prime} = A, yp′′=0y_p^{\prime\prime} = 0. Substituting:

0+3A+2(Ax+B)=4x+1  ⟹  2Ax+(3A+2B)=4x+1 0 + 3A + 2(Ax + B) = 4x + 1 \implies 2Ax + (3A + 2B) = 4x + 1

Matching: A=2A = 2 and 3(2)+2B=1  ⟹  B=−523(2) + 2B = 1 \implies B = -\tfrac{5}{2}.

y=c1e−x+c2e−2x+2x−52 \boxed{y = c_1 e^{-x} + c_2 e^{-2x} + 2x - \frac{5}{2}}

Problem 14: Resonance (Repeated Trial Function)

Medium

Find the general solution of y′′−4y′+4y=3e2x y^{\prime\prime} - 4y^{\prime} + 4y = 3e^{2x} .

  1. Solve the homogeneous equation and explain why the naive trial yp=Ae2x y_p = Ae^{2x} fails.
  2. Use the modified trial yp=Ax2e2x y_p = Ax^2 e^{2x} to find the particular solution.
Hint
The homogeneous solution contains e2xe^{2x} and xe2xxe^{2x} (repeated root r=2r=2). Because both overlap with Ae2xAe^{2x} and Axe2xAxe^{2x}, the trial function must be multiplied by x2x^2 to avoid redundancy. Compute yp′y_p^{\prime} and yp′′y_p^{\prime\prime} carefully using the product rule.
View Solution
Solution to question 1:

Characteristic equation: (r−2)2=0(r-2)^2 = 0, so yh=(c1+c2x)e2xy_h = (c_1 + c_2 x)e^{2x}. Both e2xe^{2x} and xe2xxe^{2x} are already in yhy_h, so Ae2xAe^{2x} and Axe2xAxe^{2x} yield zero when substituted.

Solution to question 2:

Let yp=Ax2e2xy_p = Ax^2 e^{2x}. Then:

yp′=A(2x+2x2)e2x,yp′′=A(2+8x+4x2)e2x y_p^{\prime} = A(2x + 2x^2)e^{2x}, \quad y_p^{\prime\prime} = A(2 + 8x + 4x^2)e^{2x}

Substitute into y′′−4y′+4yy^{\prime\prime} - 4y^{\prime} + 4y:

A(2+8x+4x2)e2x−4A(2x+2x2)e2x+4Ax2e2x=2Ae2x=3e2x A(2 + 8x + 4x^2)e^{2x} - 4A(2x + 2x^2)e^{2x} + 4Ax^2 e^{2x} = 2Ae^{2x} = 3e^{2x}

So A=32A = \tfrac{3}{2}.

y=(c1+c2x)e2x+32x2e2x \boxed{y = (c_1 + c_2 x)e^{2x} + \frac{3}{2}x^2 e^{2x}}

Problem 15: Sinusoidal Forcing and IVP

Hard

Solve the IVP y′′+9y=2sin⁡3x,y(0)=0,y′(0)=0 y^{\prime\prime} + 9y = 2\sin 3x, \quad y(0) = 0, \quad y^{\prime}(0) = 0 .

  1. Note why a naive trial yp=Acos⁡3x+Bsin⁡3x y_p = A\cos 3x + B\sin 3x leads to resonance and state the correct trial function.
  2. Find the complete particular and general solution, then apply the initial conditions.
Hint
The homogeneous solution is c1cos⁡3x+c2sin⁡3xc_1\cos 3x + c_2\sin 3x, so the forcing frequency matches the natural frequency. Multiply the trial by xx: guess yp=x(Acos⁡3x+Bsin⁡3x)y_p = x(A\cos 3x + B\sin 3x). After computing derivatives, collect like terms and match coefficients.
View Solution
Solution to question 1:

The homogeneous solution is yh=c1cos⁡3x+c2sin⁡3xy_h = c_1\cos 3x + c_2\sin 3x. The forcing term sin⁡3x\sin 3x duplicates part of yhy_h, so we use yp=x(Acos⁡3x+Bsin⁡3x)y_p = x(A\cos 3x + B\sin 3x).

Solution to question 2:

Computing yp′′y_p^{\prime\prime} and substituting into y′′+9yy^{\prime\prime} + 9y yields −6Asin⁡3x+6Bcos⁡3x=2sin⁡3x-6A\sin 3x + 6B\cos 3x = 2\sin 3x. Matching:

−6A=2  ⟹  A=−13,6B=0  ⟹  B=0 -6A = 2 \implies A = -\frac{1}{3}, \quad 6B = 0 \implies B = 0 yp=−x3cos⁡3x y_p = -\frac{x}{3}\cos 3x

General solution: y=c1cos⁡3x+c2sin⁡3x−x3cos⁡3xy = c_1\cos 3x + c_2\sin 3x - \dfrac{x}{3}\cos 3x.

Apply y(0)=0y(0) = 0: c1=0c_1 = 0. Differentiate and apply y′(0)=0y^{\prime}(0) = 0: 3c2−13=0  ⟹  c2=193c_2 - \tfrac{1}{3} = 0 \implies c_2 = \tfrac{1}{9}.

y=sin⁡3x9−xcos⁡3x3 \boxed{y = \frac{\sin 3x}{9} - \frac{x\cos 3x}{3}}

Variation of Parameters

The method of variation of parameters finds a particular solution yp=u1(x) y1+u2(x) y2y_p = u_1(x)\,y_1 + u_2(x)\,y_2 for any nonhomogeneous linear ODE y′′+P(x)y′+Q(x)y=f(x)y^{\prime\prime} + P(x)y^{\prime} + Q(x)y = f(x), provided a fundamental set of solutions {y1,y2}\{y_1, y_2\} of the homogeneous equation is known. Unlike undetermined coefficients, this method imposes no restrictions on the form of f(x)f(x). The formulas are u1′=−y2f/W u_1^{\prime} = -y_2 f / W and u2′=y1f/W u_2^{\prime} = y_1 f / W , where WW is the Wronskian.

Problem 16: Variation of Parameters (Exponential Forcing)

Medium

Use variation of parameters to find a particular solution of y′′−y=ex y^{\prime\prime} - y = e^x .

  1. Identify y1y_1, y2y_2, and compute the Wronskian.
  2. Find u1u_1 and u2u_2, then write ypy_p.
Hint
The homogeneous equation y′′−y=0y^{\prime\prime} - y = 0 has characteristic roots r=±1r = \pm 1, giving y1=exy_1 = e^x and y2=e−xy_2 = e^{-x}. Here f(x)=exf(x) = e^x. One of the integrals ∫u1′ dx\int u_1^{\prime}\,dx will need to be handled carefully because y1=exy_1 = e^x and f(x)=exf(x) = e^x have the same exponential.
View Solution
Solution to question 1: W=ex(−e−x)−e−x(ex)=−1−1=−2 W = e^x(-e^{-x}) - e^{-x}(e^x) = -1 - 1 = -2 Solution to question 2: u1′=−y2fW=−e−x⋅ex−2=12  ⟹  u1=x2 u_1^{\prime} = -\frac{y_2 f}{W} = -\frac{e^{-x}\cdot e^x}{-2} = \frac{1}{2} \implies u_1 = \frac{x}{2} u2′=y1fW=ex⋅ex−2=−e2x2  ⟹  u2=−e2x4 u_2^{\prime} = \frac{y_1 f}{W} = \frac{e^x \cdot e^x}{-2} = -\frac{e^{2x}}{2} \implies u_2 = -\frac{e^{2x}}{4} yp=x2ex−e2x4e−x=xex2−ex4 y_p = \frac{x}{2}e^x - \frac{e^{2x}}{4}e^{-x} = \frac{x e^x}{2} - \frac{e^x}{4}

The term −ex4-\tfrac{e^x}{4} is part of yhy_h, so the essential particular solution is:

yp=xex2 \boxed{y_p = \frac{x e^x}{2}}

Problem 17: Variation of Parameters (Trigonometric Forcing)

Medium

Find the general solution of y′′+y=sec⁡x y^{\prime\prime} + y = \sec x on −π/2<x<π/2 -\pi/2 < x < \pi/2 .

  1. State the homogeneous solution and set up the variation of parameters formulas.
  2. Evaluate the necessary integrals and write the complete general solution.
Hint
Here y1=cos⁡xy_1 = \cos x, y2=sin⁡xy_2 = \sin x, and W=1W = 1. The forcing function f=sec⁡xf = \sec x cannot be handled by undetermined coefficients, which makes this a natural candidate for variation of parameters. You will need ∫sin⁡xsec⁡x dx\int \sin x \sec x\,dx and ∫cos⁡xsec⁡x dx\int \cos x \sec x\,dx.
View Solution
Solution to question 1:

yh=c1cos⁡x+c2sin⁡xy_h = c_1\cos x + c_2\sin x, W=cos⁡2x+sin⁡2x=1W = \cos^2 x + \sin^2 x = 1.

u1′=−sin⁡x⋅sec⁡x1=−tan⁡x,u2′=cos⁡x⋅sec⁡x1=1 u_1^{\prime} = -\frac{\sin x \cdot \sec x}{1} = -\tan x, \quad u_2^{\prime} = \frac{\cos x \cdot \sec x}{1} = 1 Solution to question 2: u1=ln⁡∣cos⁡x∣,u2=x u_1 = \ln|\cos x|, \quad u_2 = x yp=cos⁡xln⁡(cos⁡x)+xsin⁡x y_p = \cos x \ln(\cos x) + x\sin x y=c1cos⁡x+c2sin⁡x+cos⁡xln⁡(cos⁡x)+xsin⁡x \boxed{y = c_1\cos x + c_2\sin x + \cos x\ln(\cos x) + x\sin x}

Problem 18: Variation of Parameters with Non-Constant Coefficients (Euler Equation)

Hard

Consider the Euler (Cauchy–Euler) equation x2y′′−2xy′+2y=x3ln⁡x x^2 y^{\prime\prime} - 2xy^{\prime} + 2y = x^3\ln x for x>0x > 0.

  1. Verify that y1=xy_1 = x and y2=x2y_2 = x^2 are solutions of the associated homogeneous equation x2y′′−2xy′+2y=0x^2 y^{\prime\prime} - 2xy^{\prime} + 2y = 0 and compute their Wronskian.
  2. Rewrite the equation in standard form and apply variation of parameters to find the general solution.
Hint
To bring the equation to standard form y′′+Py′+Qy=fy^{\prime\prime} + Py^{\prime} + Qy = f, divide through by x2x^2. The forcing term in standard form is f(x)=xln⁡xf(x) = x\ln x. With W=x2W = x^2, compute u1′=−y2f/Wu_1^{\prime} = -y_2 f/W and u2′=y1f/Wu_2^{\prime} = y_1 f/W, then integrate by parts.
View Solution
Solution to question 1:

For y1=xy_1 = x: y1′′=0y_1^{\prime\prime} = 0, so x2(0)−2x(1)+2x=0x^2(0) - 2x(1) + 2x = 0. ✓\checkmark

For y2=x2y_2 = x^2: y2′′=2y_2^{\prime\prime} = 2, so x2(2)−2x(2x)+2x2=2x2−4x2+2x2=0x^2(2) - 2x(2x) + 2x^2 = 2x^2 - 4x^2 + 2x^2 = 0. ✓\checkmark

W=x(2x)−x2(1)=2x2−x2=x2 W = x(2x) - x^2(1) = 2x^2 - x^2 = x^2 Solution to question 2:

Standard form: y′′−2xy′+2x2y=xln⁡xy^{\prime\prime} - \tfrac{2}{x}y^{\prime} + \tfrac{2}{x^2}y = x\ln x.

u1′=−x2⋅xln⁡xx2=−xln⁡x  ⟹  u1=−x22ln⁡x+x24 u_1^{\prime} = -\frac{x^2 \cdot x\ln x}{x^2} = -x\ln x \implies u_1 = -\frac{x^2}{2}\ln x + \frac{x^2}{4} u2′=x⋅xln⁡xx2=ln⁡x  ⟹  u2=xln⁡x−x u_2^{\prime} = \frac{x \cdot x\ln x}{x^2} = \ln x \implies u_2 = x\ln x - x yp=u1x+u2x2=(−x2ln⁡x2+x24)x+(xln⁡x−x)x2 y_p = u_1 x + u_2 x^2 = \left(-\frac{x^2\ln x}{2} + \frac{x^2}{4}\right)x + (x\ln x - x)x^2 yp=x32ln⁡x−3x34 y_p = \frac{x^3}{2}\ln x - \frac{3x^3}{4} y=c1x+c2x2+x32ln⁡x−3x34 \boxed{y = c_1 x + c_2 x^2 + \frac{x^3}{2}\ln x - \frac{3x^3}{4}}

Applications of Differential Equations

Differential equations model a wide range of real-world phenomena. This section presents applied problems drawn from exponential growth and decay, Newton’s law of cooling, and mechanical vibrations (spring-mass systems). Setting up the governing ODE from a physical description is itself a critical skill, tested frequently in engineering and applied mathematics courses.

Problem 19: Radioactive Decay and Half-Life

Easy

A radioactive substance decays at a rate proportional to the amount present. The half-life of the substance is 8 years.

  1. Write and solve the governing differential equation for A(t)A(t), the amount remaining at time tt.
  2. If the initial amount is 200 g, how much remains after 20 years? Give an exact answer and a decimal approximation.
Hint
The governing equation is A′=kAA^{\prime} = kA with k<0k < 0. Use the half-life condition A(8)=A0/2A(8) = A_0/2 to determine k=−ln⁡2/8k = -\ln 2 / 8.
View Solution
Solution to question 1: A′=kA  ⟹  A(t)=A0ekt A^{\prime} = kA \implies A(t) = A_0 e^{kt}

From A(8)=A0/2A(8) = A_0/2: e8k=1/2  ⟹  k=−ln⁡28e^{8k} = 1/2 \implies k = -\dfrac{\ln 2}{8}.

A(t)=A0 e−(ln⁡2 / 8) t=A0⋅2−t/8 A(t) = A_0\, e^{-(\ln 2\,/\,8)\,t} = A_0 \cdot 2^{-t/8} Solution to question 2: A(20)=200⋅2−20/8=200⋅2−5/2=20042=502=252≈35.36 g A(20) = 200 \cdot 2^{-20/8} = 200 \cdot 2^{-5/2} = \frac{200}{4\sqrt{2}} = \frac{50}{\sqrt{2}} = 25\sqrt{2} \approx 35.36 \text{ g} A(20)=252≈35.4 g \boxed{A(20) = 25\sqrt{2} \approx 35.4 \text{ g}}

Problem 20: Newton’s Law of Cooling

Medium

A cup of coffee at 90°C is placed in a room maintained at 20°C. After 10 minutes, the coffee has cooled to 70°C.

  1. Set up and solve the IVP for the temperature T(t)T(t) using Newton’s law of cooling.
  2. Find the time at which the coffee reaches 40°C.
Hint
Newton’s law of cooling: dTdt=k(T−Troom)\dfrac{dT}{dt} = k(T - T_{\text{room}}). Let u=T−20u = T - 20 to get a simpler separable equation. After solving, use T(10)=70T(10) = 70 to find kk, then solve T(t∗)=40T(t^*) = 40 for t∗t^*.
View Solution
Solution to question 1:

Let u=T−20u = T - 20. Then u′=kuu^{\prime} = ku, so u=u0ektu = u_0 e^{kt}. At t=0t = 0: u0=70u_0 = 70. Thus T=20+70ektT = 20 + 70e^{kt}.

From T(10)=70T(10) = 70: 70e10k=50  ⟹  k=ln⁡(5/7)1070e^{10k} = 50 \implies k = \dfrac{\ln(5/7)}{10}.

T(t)=20+70(57)t/10 T(t) = 20 + 70\left(\frac{5}{7}\right)^{t/10} Solution to question 2:

Set T=40T = 40: 70(57)t/10=20  ⟹  (57)t/10=2770\left(\tfrac{5}{7}\right)^{t/10} = 20 \implies \left(\tfrac{5}{7}\right)^{t/10} = \tfrac{2}{7}.

t10=ln⁡(2/7)ln⁡(5/7)  ⟹  t=10ln⁡(2/7)ln⁡(5/7)≈38.1 min \frac{t}{10} = \frac{\ln(2/7)}{\ln(5/7)} \implies t = \frac{10\ln(2/7)}{\ln(5/7)} \approx 38.1 \text{ min} t≈38.1 minutes \boxed{t \approx 38.1 \text{ minutes}}

Problem 21: Damped Spring-Mass System

Hard

A mass of 1 kg is attached to a spring with spring constant k=13k = 13 N/m. The system experiences damping with coefficient c=4c = 4 N·s/m. At t=0t = 0 the mass is displaced 0.5 m from equilibrium and released from rest.

  1. Write the IVP governing the displacement x(t)x(t) and classify the damping type.
  2. Solve the IVP completely and describe the long-term behavior of the solution.
Hint
Newton’s second law gives mx′′+cx′+kx=0mx^{\prime\prime} + cx^{\prime} + kx = 0. With m=1m=1, c=4c=4, k=13k=13, compute the discriminant c2−4mkc^2 - 4mk to classify damping. A negative discriminant indicates underdamping, leading to complex roots and oscillatory decay.
View Solution
Solution to question 1:

The IVP is x′′+4x′+13x=0,x(0)=0.5,x′(0)=0 x^{\prime\prime} + 4x^{\prime} + 13x = 0, \quad x(0) = 0.5, \quad x^{\prime}(0) = 0 .

Discriminant: 42−4(1)(13)=16−52=−36<04^2 - 4(1)(13) = 16 - 52 = -36 < 0. The system is underdamped.

Solution to question 2:

Characteristic roots: r=−4±6i2=−2±3ir = \dfrac{-4 \pm 6i}{2} = -2 \pm 3i.

x(t)=e−2t(c1cos⁡3t+c2sin⁡3t) x(t) = e^{-2t}(c_1\cos 3t + c_2\sin 3t)

Apply x(0)=0.5x(0) = 0.5: c1=0.5c_1 = 0.5.

Apply x′(0)=0x^{\prime}(0) = 0: x′(0)=−2c1+3c2=0  ⟹  c2=13x^{\prime}(0) = -2c_1 + 3c_2 = 0 \implies c_2 = \tfrac{1}{3}.

x(t)=e−2t ⁣(12cos⁡3t+13sin⁡3t) \boxed{x(t) = e^{-2t}\!\left(\frac{1}{2}\cos 3t + \frac{1}{3}\sin 3t\right)}

As t→∞t \to \infty, the factor e−2t→0e^{-2t} \to 0, so the displacement decays to zero. The solution oscillates with pseudo-period 2π3\tfrac{2\pi}{3} seconds while the amplitude shrinks exponentially, the hallmark of underdamped oscillation.