Skip to main content

Differential Equations — Diagnostic Tests

Unit Tests

UT-1: First Order Separable Equations

Question: Solve dydx=xy\frac{dy}{dx} = \frac{x}{y} given that y=2y = 2 when x=1x = 1. (b) Solve dydx=xy\frac{dy}{dx} = xy given that y=1y = 1 when x=0x = 0. (c) Solve dydx=y2+1y\frac{dy}{dx} = \frac{y^2 + 1}{y} given that y=0y = 0 when x=0x = 0. (d) Explain what is meant by a "particular solution" versus a "general solution".

Solution:

(a) ydy=xdxy\,dy = x\,dx. y22=x22+C\frac{y^2}{2} = \frac{x^2}{2} + C. y2=x2+Cy^2 = x^2 + C. At (1,2)(1,2): 4=1+C4 = 1 + C, C=3C = 3. y2=x2+3y^2 = x^2 + 3, y=x2+3y = \sqrt{x^2 + 3} (taking positive root).

(b) dyy=xdx\frac{dy}{y} = x\,dx. lny=x22+C\ln|y| = \frac{x^2}{2} + C. y=Aex2/2y = Ae^{x^2/2}. At (0,1)(0,1): 1=A1 = A, so y=ex2/2y = e^{x^2/2}.

(c) yy2+1dy=dx\frac{y}{y^2 + 1}\,dy = dx. Integrating: 12ln(y2+1)=x+C\frac{1}{2}\ln(y^2 + 1) = x + C. ln(y2+1)=2x+C\ln(y^2 + 1) = 2x + C. At (0,0)(0,0): ln1=C=0\ln 1 = C = 0. y2+1=e2xy^2 + 1 = e^{2x}, y=e2x1y = \sqrt{e^{2x} - 1}.

(d) The general solution contains an arbitrary constant CC and represents the family of all possible solutions. The particular solution is obtained by using an initial/boundary condition to find the value of CC, giving a single specific solution.

UT-2: Second Order Linear DEs

Question: (a) Solve d2ydx25dydx+6y=0\frac{d^2y}{dx^2} - 5\frac{dy}{dx} + 6y = 0. (b) Solve d2ydx2+4y=0\frac{d^2y}{dx^2} + 4y = 0 given that y=1y = 1 and dydx=0\frac{dy}{dx} = 0 when x=0x = 0. (c) Solve d2ydx2+6dydx+9y=0\frac{d^2y}{dx^2} + 6\frac{dy}{dx} + 9y = 0. (d) Explain the significance of the discriminant of the auxiliary equation.

Solution:

(a) Auxiliary equation: m25m+6=0m^2 - 5m + 6 = 0. (m2)(m3)=0(m-2)(m-3) = 0. m=2,3m = 2, 3. General solution: y=Ae2x+Be3xy = Ae^{2x} + Be^{3x}.

(b) m2+4=0m^2 + 4 = 0. m=±2im = \pm 2i. General solution: y=Acos2x+Bsin2xy = A\cos 2x + B\sin 2x. y(0)=1y(0) = 1: A=1A = 1. y(0)=0y'(0) = 0: 2B=02B = 0, B=0B = 0. Particular solution: y=cos2xy = \cos 2x.

(c) m2+6m+9=0m^2 + 6m + 9 = 0. (m+3)2=0(m+3)^2 = 0. m=3m = -3 (repeated root). General solution: y=(A+Bx)e3xy = (A + Bx)e^{-3x}.

(d) The discriminant Δ=b24ac\Delta = b^2 - 4ac of the auxiliary equation am2+bm+c=0am^2 + bm + c = 0 determines the nature of solutions:

  • Δ>0\Delta \gt 0: Two distinct real roots, general solution y=Aem1x+Bem2xy = Ae^{m_1x} + Be^{m_2x}.
  • Δ=0\Delta = 0: One repeated real root, general solution y=(A+Bx)emxy = (A + Bx)e^{mx}.
  • Δ<0\Delta \lt 0: Complex conjugate roots m=α±βim = \alpha \pm \beta i, general solution y=eαx(Acosβx+Bsinβx)y = e^{\alpha x}(A\cos\beta x + B\sin\beta x).

UT-3: Second Order DEs with RHS

Question: (a) Find the particular integral and general solution of d2ydx23dydx+2y=4\frac{d^2y}{dx^2} - 3\frac{dy}{dx} + 2y = 4. (b) Solve d2ydx2+y=10cosx\frac{d^2y}{dx^2} + y = 10\cos x. (c) Solve d2ydx24y=2e3x\frac{d^2y}{dx^2} - 4y = 2e^{3x}.

Solution:

(a) CFE: m23m+2=0m^2 - 3m + 2 = 0, m=1,2m = 1, 2. CF: yc=Aex+Be2xy_c = Ae^x + Be^{2x}. PI: try yp=ky_p = k. 00+2k=40 - 0 + 2k = 4, k=2k = 2. GS: y=Aex+Be2x+2y = Ae^x + Be^{2x} + 2.

(b) CFE: m2+1=0m^2 + 1 = 0, m=±im = \pm i. CF: yc=Acosx+Bsinxy_c = A\cos x + B\sin x. PI: since cosx\cos x is in the CF, try yp=x(Ccosx+Dsinx)y_p = x(C\cos x + D\sin x). yp=Ccosx+Dsinx+x(Csinx+Dcosx)y_p' = C\cos x + D\sin x + x(-C\sin x + D\cos x). yp=Csinx+DcosxCsinx+Dcosx+x(CcosxDsinx)=2Csinx+2Dcosxx(Ccosx+Dsinx)y_p'' = -C\sin x + D\cos x - C\sin x + D\cos x + x(-C\cos x - D\sin x) = -2C\sin x + 2D\cos x - x(C\cos x + D\sin x). yp+yp=2Csinx+2Dcosx=10cosxy_p'' + y_p = -2C\sin x + 2D\cos x = 10\cos x. 2D=10D=52D = 10 \Rightarrow D = 5, 2C=0C=0-2C = 0 \Rightarrow C = 0. PI: yp=5xsinxy_p = 5x\sin x. GS: y=Acosx+Bsinx+5xsinxy = A\cos x + B\sin x + 5x\sin x.

(c) CFE: m24=0m^2 - 4 = 0, m=±2m = \pm 2. CF: yc=Ae2x+Be2xy_c = Ae^{2x} + Be^{-2x}. PI: try yp=ce3xy_p = ce^{3x}. 9ce3x4ce3x=2e3x9ce^{3x} - 4ce^{3x} = 2e^{3x}. 5c=25c = 2, c=2/5c = 2/5. GS: y=Ae2x+Be2x+25e3xy = Ae^{2x} + Be^{-2x} + \frac{2}{5}e^{3x}.


Integration Tests

IT-1: Modelling with DEs (with Mechanics)

Question: A particle of mass mm falls under gravity with air resistance proportional to velocity: mdvdt=mgkvm\frac{dv}{dt} = mg - kv. (a) Solve the DE given v=0v = 0 when t=0t = 0. (b) Find the terminal velocity. (c) Calculate vv when t=m/kt = m/k as a fraction of terminal velocity. (d) Sketch the velocity-time graph.

Solution:

(a) dvdt=gkmv\frac{dv}{dt} = g - \frac{k}{m}v. Let α=k/m\alpha = k/m: dvdt+αv=g\frac{dv}{dt} + \alpha v = g. Integrating factor: eαte^{\alpha t}. ddt(veαt)=geαt\frac{d}{dt}(ve^{\alpha t}) = ge^{\alpha t}. veαt=LBgRB◆◆LBαRBeαt+Cve^{\alpha t} = \frac◆LB◆g◆RB◆◆LB◆\alpha◆RB◆e^{\alpha t} + C. v=LBgRB◆◆LBαRB+Ceαt=mgk+Cekt/mv = \frac◆LB◆g◆RB◆◆LB◆\alpha◆RB◆ + Ce^{-\alpha t} = \frac{mg}{k} + Ce^{-kt/m}. At t=0t = 0: 0=mg/k+C0 = mg/k + C, C=mg/kC = -mg/k. v=mgk(1ekt/m)v = \frac{mg}{k}(1 - e^{-kt/m}).

(b) Terminal velocity: as tt \to \infty, ekt/m0e^{-kt/m} \to 0, so vterm=mgkv_{\text{term}} = \frac{mg}{k}.

(c) At t=m/kt = m/k: v=mgk(1e1)=mgk(10.368)=0.632vtermv = \frac{mg}{k}(1 - e^{-1}) = \frac{mg}{k}(1 - 0.368) = 0.632 v_{\text{term}}. The particle reaches approximately 63.2% of terminal velocity.

(d) The graph starts at v=0v = 0 with steep gradient gg, curves concavely, and asymptotically approaches v=mg/kv = mg/k. It is a typical exponential approach curve.

IT-2: Coupled DEs (with Matrices)

Question: Solve the system: dxdt=2x+y\frac{dx}{dt} = 2x + y, dydt=x+2y\frac{dy}{dt} = x + 2y, with x(0)=1x(0) = 1, y(0)=0y(0) = 0. (a) Write in matrix form. (b) Find eigenvalues and eigenvectors of the coefficient matrix. (c) Solve the system. (d) Calculate x(1)x(1) and y(1)y(1).

Solution:

(a) ddt(xy)=(2112)(xy)\frac{d}{dt}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix}.

(b) From the matrix diagnostics: eigenvalues λ1=3\lambda_1 = 3 (eigenvector (11)\begin{pmatrix}1\\1\end{pmatrix}) and λ2=1\lambda_2 = 1 (eigenvector (11)\begin{pmatrix}1\\-1\end{pmatrix}).

(c) (xy)=c1e3t(11)+c2et(11)\begin{pmatrix}x\\y\end{pmatrix} = c_1 e^{3t}\begin{pmatrix}1\\1\end{pmatrix} + c_2 e^{t}\begin{pmatrix}1\\-1\end{pmatrix}.

(10)=c1(11)+c2(11)\begin{pmatrix}1\\0\end{pmatrix} = c_1\begin{pmatrix}1\\1\end{pmatrix} + c_2\begin{pmatrix}1\\-1\end{pmatrix}. c1+c2=1c_1 + c_2 = 1 and c1c2=0c_1 - c_2 = 0, so c1=c2=1/2c_1 = c_2 = 1/2.

x=e3t+et2x = \frac{e^{3t} + e^t}{2}, y=e3tet2y = \frac{e^{3t} - e^t}{2}.

(d) x(1)=e3+e2=20.086+2.7182=11.40x(1) = \frac{e^3 + e}{2} = \frac{20.086 + 2.718}{2} = 11.40. y(1)=e3e2=20.0862.7182=8.68y(1) = \frac{e^3 - e}{2} = \frac{20.086 - 2.718}{2} = 8.68.

IT-3: Forming DEs from Context (with Complex Numbers)

Question: The current I(t)I(t) in an RL circuit with inductance LL and resistance RR satisfies LdIdt+RI=V0cos(ωt)L\frac{dI}{dt} + RI = V_0\cos(\omega t). (a) Solve this DE given I(0)=0I(0) = 0. (b) Identify the transient and steady-state components. (c) Find the amplitude of the steady-state current. (d) Explain what happens when ω0\omega \to 0.

Solution:

(a) dIdt+RLI=V0Lcos(ωt)\frac{dI}{dt} + \frac{R}{L}I = \frac{V_0}{L}\cos(\omega t). Let α=R/L\alpha = R/L.

IF: eαte^{\alpha t}. ddt(Ieαt)=V0Leαtcos(ωt)\frac{d}{dt}(Ie^{\alpha t}) = \frac{V_0}{L}e^{\alpha t}\cos(\omega t).

The PI requires Ip=Acos(ωt)+Bsin(ωt)I_p = A\cos(\omega t) + B\sin(\omega t). Ip=Aωsin(ωt)+Bωcos(ωt)I_p' = -A\omega\sin(\omega t) + B\omega\cos(\omega t). αIp+Ip=αAcos+αBsinAωsin+Bωcos=V0Lcos(ωt)\alpha I_p + I_p' = \alpha A\cos + \alpha B\sin - A\omega\sin + B\omega\cos = \frac{V_0}{L}\cos(\omega t).

αA+Bω=V0/L\alpha A + B\omega = V_0/L and αBAω=0\alpha B - A\omega = 0, so B=Aω/αB = A\omega/\alpha.

Aα+Aω2/α=V0/LA\alpha + A\omega^2/\alpha = V_0/L. A=LBV0αRB◆◆LBL(α2+ω2)RB=LBV0RRB◆◆LBL2(ω2+R2/L2)RB=LBV0RRB◆◆LBR2+ω2L2RBA = \frac◆LB◆V_0\alpha◆RB◆◆LB◆L(\alpha^2 + \omega^2)◆RB◆ = \frac◆LB◆V_0 R◆RB◆◆LB◆L^2(\omega^2 + R^2/L^2)◆RB◆ = \frac◆LB◆V_0 R◆RB◆◆LB◆R^2 + \omega^2 L^2◆RB◆.

I=CeRt/L+LBV0RB◆◆LBR2+ω2L2RB[Rcos(ωt)+ωLsin(ωt)]I = Ce^{-Rt/L} + \frac◆LB◆V_0◆RB◆◆LB◆R^2 + \omega^2 L^2◆RB◆[R\cos(\omega t) + \omega L\sin(\omega t)].

At t=0t = 0: 0=C+LBV0RRB◆◆LBR2+ω2L2RB0 = C + \frac◆LB◆V_0 R◆RB◆◆LB◆R^2 + \omega^2 L^2◆RB◆, so C=LBV0RRB◆◆LBR2+ω2L2RBC = -\frac◆LB◆V_0 R◆RB◆◆LB◆R^2 + \omega^2 L^2◆RB◆.

(b) Transient: CeRt/LCe^{-Rt/L} (decays to zero as tt \to \infty). Steady-state: LBV0RB◆◆LBR2+ω2L2RB[Rcos(ωt)+ωLsin(ωt)]\frac◆LB◆V_0◆RB◆◆LB◆R^2 + \omega^2 L^2◆RB◆[R\cos(\omega t) + \omega L\sin(\omega t)].

(c) Amplitude =LBV0RB◆◆LBR2+ω2L2RBLBR2+ω2L2RB=LBV0RB◆◆LBLBR2+ω2L2RB◆◆RB= \frac◆LB◆V_0◆RB◆◆LB◆R^2 + \omega^2 L^2◆RB◆\sqrt◆LB◆R^2 + \omega^2 L^2◆RB◆ = \frac◆LB◆V_0◆RB◆◆LB◆\sqrt◆LB◆R^2 + \omega^2 L^2◆RB◆◆RB◆.

(d) When ω0\omega \to 0 (DC circuit): amplitude V0R=I0\to \frac{V_0}{R} = I_0. The current approaches V0/RV_0/R with time constant L/RL/R. This is the classic RL circuit charging: the inductor initially opposes current flow, but as the magnetic field builds, the current asymptotically approaches V0/RV_0/R.