Skip to main content

Tutorial 1 & 2: Differential Equations & First Order ODE

Tutorial Question

  1. Identify 5 physical laws/ theory that are frequently used in your field of study (i.e. Mechanical/Electrical/Chemical/Civil/Biomedical) and show that they can be transformed into the form of differential equation.

    Sample Solution
    FieldMechanical Engineering
    ThermodynamicFourier’s heat equation, q=kdTdxq=-k'\frac{dT}{dx} where kk' is the thermal conductivity, dTdx\frac{dT}{dx} is the change of temperature in direction xx and qq is the rate of flow of heat energy/heat flux.
    Fluid MechanicsLaw of conservation of mass, dVdt=0\frac{dV}{dt} =0, where the total volumetric flow of water enter and leaving the tank during duration dtdt is equal, i.e A1v1=A2v2A_{1} v_{1} =A_{2} v_{2}.
    Applied Mechanics FieldNewton's 2nd law of motion, dv(t)dt=F(t)m\frac{dv(t)}{dt} =\frac{\sum F(t)}{m}.
    Vibration FieldMass-damper-spring system: Equations of motion, md2xdt2+cdxdt+kx=0m\frac{d^{2} x}{dt^{2}} +c\frac{dx}{dt} +kx=0
    Mechanics of Materials FieldDifferential equation for the elastic curve, EId2ydx2=PaLxEI\frac{d^{2} y}{dx^{2}} =-P\frac{a}{L} x
    FieldBiomedical Engineering
    Tumor growth kineticsTumor growth kinetics in the human body follow relatively law that can be expressed using ODE T˙=aT(1bT)cNTDTKT(1eM)T\dot T=aT(1-bT)-cNT-DT-K_T(1-e^{-M})T, where the T(t)T(t), N(t)N(t), L(t)L(t), C(t)C(t), M(t)M(t) and I(t)I(t) represent the tumour cell population
    Mathematical models in oncologyMathematical models in oncology aid in the design of drugs and understanding of their mechanisms of action by simulation of drug biodistribution, drug effects, and interaction between tumor and healthy cells. dX0dt=k0X0\frac{dX_0}{dt}=-k_0X_0, dXpdt=k0X0+aXtγXpβXp\frac{dX_p}{dt}=k_0X_0+aX_t-\gamma X_p-\beta X_p, dXtdt=γXpαXt\frac{dX_t}{dt}=\gamma X_p-\alpha X_t. The initial condition X0(0)X_0(0) is the given dose. The initial drug amount in the plasma compartment Xp(0)X_p (0) and in the tumor compartment Xt(0)X_t(0) is zero.
  2. Classify each equation according to its order, linearity/non-linearity, and homogeneity/non-homogeneity. Also identify its dependent & independent variables in each case. Hence, find the solutions except 2nd order ODE and nonhomogeneous dydx=f(x,y)g(x,y)\frac{dy}{dx}=\frac{f(x,y)}{g(x,y)} cases. Verify that the solution that you find is a true solution.

    i. 5xd2ydx24xdydxsin2x=0,y(0)=0,y(0)=05x\frac{d^{2} y}{dx^{2}} -\frac{4}{x}\frac{dy}{dx} -\sin 2x=0,\quad y( 0) =0,\quad y'( 0) =0

    Solution
    • Dependent variable: yy

    • Independent variable: xx

    2nd order linear nonhomogeneous ordinary differential equation. Initial conditions are provided.

    ii. x2d2ydx23xdydx=4y,y(0)=0,y(0)=0x^{2}\frac{d^{2} y}{dx^{2}} -3x\frac{dy}{dx} =4y,\quad y( 0) =0,\quad y'(0) =0

    Solution
    • Dependent variable: yy

    • Independent variable: xx

    2nd order linear homogeneous ordinary differential equation. Boundary conditions are provided

    iii. 5x2ydydx+y3+x3=0,y(0)=35x^2y\frac{dy}{dx}+y^3+x^3=0,\qquad y(0)=3

    Solution
    • Dependent variable: yy

    • Independent variable: xx

    It is 1st order nonlinear ordinary differential equation. dydx+4xy=x3y2\frac{d y}{d x}+\frac{4}{x} y=x^3 y^2 because of nonlinear component x3y2x^3 y^2.

    To check the homogeneity for 1st 1^{\text {st }} order nonlinear differential equation, we rearrange it to the dydx=f(x,y)g(x,y)\frac{d y}{d x}=\frac{f(x, y)}{g(x, y)} form, where dydx=x4y24yxf(λx,λy)g(λx,λy)=(λx)4(λy)24(λy)(λx)=λ6x4y24(λy)(λx)\frac{d y}{d x}=\frac{x^4 y^2-4 y}{x} \cdot \frac{f(\lambda x, \lambda y)}{g(\lambda x, \lambda y)}=\frac{(\lambda x)^4(\lambda y)^2-4(\lambda y)}{(\lambda x)}=\frac{\lambda^6 x^4 y^2-4(\lambda y)}{(\lambda x)}. Since f(x,y)f(x, y) and g(x,y)g(x, y) are nonhomogenous equations of various degree, therefore it is a nonhomogeneous equation.

    Nonhomogeneous dydx=f(x,y)g(x,y)\frac{d y}{d x}=\frac{f(x, y)}{g(x, y)} method is not covered in this study. Check if other analytical approach is possible to solve the problem instead of using nonhomogeneous dydx=f(x,y)g(x,y)\frac{d y}{d x}=\frac{f(x, y)}{g(x, y)} because there is at least one approach to solve a particular ODE.

    Exact Differential EquationLinear Differential EquationSeparable Differential EquationBernoulli Differential Equation
    Not suitable because can't find any formula that produce the derivate directly. To check there is exact solution or not use M(t,x)t(x)=N(t,x)x\frac{\partial M(t, x)}{\partial t(x)}=\frac{\partial N(t, x)}{\partial x}Not suitable for nonlinear ODE.Not possible because it is not separable.Possible. dydx+4xp(x)y=x3r(x)y2yn\frac{d y}{d x}+\underbrace{\frac{4}{x}}_{p(x)} y=\underbrace{x^3}_{r(x)} \underbrace{y^2}_{y^n}

    Using Bernoulli Differential Equation:

    dydx+4xy=x3y2\frac{d y}{d x}+\frac{4}{x} y=x^3 y^2

    Let v=y1,dvdx=y2dydxv=y^{-1}, \frac{d v}{d x}=-y^{-2} \frac{d y}{d x}

    dydx+4xy=x3y2y2dydx+4xy1=x3dvdx+4xv=x3dvdx4xv=x3\begin{aligned} \frac{d y}{d x}+\frac{4}{x} y&=x^3 y^2 \\ y^{-2} \frac{d y}{d x}+\frac{4}{x} y^{-1}&=x^3 \\ -\frac{d v}{d x}+\frac{4}{x} v&=x^3 \\ \frac{d v}{d x}-\frac{4}{x} v&=-x^3 \end{aligned}

    Step 1: Linear Form

    dvdx4xv=x3\frac{d v}{d x}-\frac{4}{x} v=-x^3, where p(x)=4x,q(x)=x3p(x)=-\frac{4}{x}, q(x)=-x^3

    Step 2: Integrating Factor

    IF=ep(x)dx=e4xdx=e4lnx=x4IF =e^{\int p(x) d x}=e^{\int-\frac{4}{x} d x}=e^{-4 \ln x}=x^4

    Step 3: Multiply

    x4dvdxx44xv=x1x^{-4} \frac{d v}{d x}-x^4 \frac{4}{x} v=-x^{-1}

    Step 4: Exact

    ddx(x4v)=x1\frac{d}{d x}\left(x^{-4} v\right)=-x^{-1}

    Step 5: Integrate

    ddx(x4v)dx=x1dxx4v=lnx+Cv=x4lnx+Cx4v=x4lnx+Cx4=y1y1=x4(Clnx)\begin{aligned} \int \frac{d}{d x}\left(x^4 v\right) d x&=\int-x^{-1} d x \\ x^4 v&=-\ln |x|+C \\ v&=-x^4 \ln |x|+C x^4 \\ v&=-x^4 \ln |x|+C x^4=y^{-1} \\ y^{-1}&=x^4(C-\ln |x|) \end{aligned}

    Given y(2)=1y(2)=-1, we get (1)1=(2)4(Cln2)C=ln2116(-1)^{-1}=(2)^4(C-\ln |2|) \gg C=\ln |2|-\frac{1}{16}

    y1=x4(ln2116lnx)y=1x4(ln2116lnx)=16x4(16ln2+1+16lnx)=16x4(1+16lnx2)\begin{aligned} y^{-1}&=x^4\left(\ln |2|-\frac{1}{16}-\ln |x|\right) \\ y&=\frac{1}{x^4\left(\ln |2|-\frac{1}{16}-\ln |x|\right)}\\ &=\frac{-16}{x^4(-16 \ln |2|+1+16 \ln |x|)}\\ &=\frac{-16}{x^4\left(1+16 \ln \left|\frac{x}{2}\right| \right)} \end{aligned}

    iv. et3dxdt3t2et3x=0,x(1)=2e^{-t^{3}}\frac{dx}{dt} -3t^{2} e{^{-t}}^{3} x=0,\quad x( 1) =2

    Solution
    • Dependent variable: xx

    • Independent variable: tt

    It is 1st order linear homogeneous ordinary differential equation

    Exact Differential EquationLinear Differential EquationSeparable Differential EquationBernoulli Differential Equation
    Suitable. Recall product rule d(xy)dx=xdydx+ydxdx\frac{d( xy)}{dx} =x\frac{dy}{dx} +y\frac{dx}{dx}Suitable as it is linear ODEPossible because it is separable.Not possible. For nonlinear only

    Using Seperable Differential Equation:

    dxx=3t2 dtlnx=t3+C\begin{aligned} \int \frac{dx}{x} & =\int 3t^{2} \ dt\\ \ln\vert x\vert & =t^{3} +C \end{aligned}

    Given x(1)=2ln2=13+CC=ln21x( 1) =2\Longrightarrow \ln\vert 2\vert =1^{3} +C\Longrightarrow C=\ln\vert 2\vert -1

    lnx=t3+ln21x=e(t3+ln21)x=0.736et3\begin{aligned} \ln\vert x\vert & =t^{3} +\ln\vert 2\vert -1\\ x & =e^{\left( t^{3} +\ln\vert 2\vert -1\right)}\\ \mathbf{x} & \mathbf{=0.736e^{t^{3}}} \end{aligned}

    Using Exact Differential Equation:

    Let M(t,x)=et3  δM(t,x)δt=3t2et3M( t,x) =e^{-t^{3}} \ \Longrightarrow \ \frac{\delta M( t,x)}{\delta t} =-3t^{2} e^{-t^{3}}

    N(t,x)=3t2et3xδN(t,x)δt=3t2et3N( t,x) =-3t^{2} e^{-t^{3}} x\Longrightarrow \frac{\delta N( t,x)}{\delta t} =-3t^{2} e^{-t^{3}}

    Therefore there is an exact solution since M(t,x)t=N(t,x)t\frac{\partial M( t,x)}{\partial t} =\frac{\partial N( t,x)}{\partial t}.

    Recall product rule d(tx)dt=tdxdt+xdtdt\frac{d( tx)}{dt} =t\frac{dx}{dt} +x\frac{dt}{dt},

    ddt(xet3)=0δddt(xet3) dt=δ0 dtxet3=Cx=Cet3\begin{aligned} \frac{d}{dt}\left( xe^{-t^{3}}\right) & =0\\ \delta \frac{d}{dt}\left( xe^{-t^{3}}\right) \ dt & =\delta 0\ dt\\ xe^{-t^{3}} & =C\\ x & =Ce^{t^{3}} \end{aligned}

    Given x(1)=2xet3=CC=2e13=0.736x( 1) =2\Longrightarrow xe^{-t^{3}} =C \Longrightarrow C=2e^{1^{3}} =0.736. Therefore, x=0.736et3\mathbf{x=0.736e^{t^{3}}}

    Using Linear Differential Equation:

    Step 1: Arrange the differential equation in the linear form of dxdtp(t)x=q(t)\frac{dx}{dt} -p( t) x=q( t).

    et3dxdt3t2et3x=0  dxdt3t2x=0e^{-t^{3}}\frac{dx}{dt} -3t^{2} e{^{-t}}^{3} x=0\ \Longrightarrow \ \frac{dx}{dt} -3t^{2} x=0 where p(t)=3t2,q(t)=0p( t) =-3t^{2} ,\quad q( t) =0

    Step 2: Create integrating factor

    IF=ep(t)dt=e(3t2)dt=et3IF=e^{\int p( t) dt} =e^{\int \left( -3t^{2}\right) dt} =e^{-t^{3}}

    Step 3: Multiply 1st ODE eqn by IFIF

    IF(dxdt)IF(q(t)x)=IF(q(t))et3dxdt3t2et3x=0\begin{aligned} IF\left(\frac{dx}{dt}\right) -IF( q( t) x) & =IF( q( t))\\ e^{-t^{3}}\frac{dx}{dt} -3t^{2} e^{-t^{3}} x & =0 \end{aligned}

    Step 4: Recognize the LHS is exact solution

    ddt(et3x)=0\frac{d}{dt}\left( e^{-t^{3}} x\right) =0

    Step 5: Integrate both side

    ddt(et3x)dt=0 dtet3x=Cx=Cet3\begin{aligned} \int \frac{d}{dt}\left( e^{-t^{3}} x\right) dt & =\int 0\ dt\\ e^{-t^{3}} x & =C\\ x & =Ce^{t^{3}} \end{aligned}

    Given x(1)=2xet3=CC=2e13=0.736x( 1) =2\Longrightarrow xe^{-t^{3}} =C \Longrightarrow C=2e^{1^{3}} =0.736.

    Therefore, x=0.736et3\mathbf{x=0.736e^{t^{3}}}

    Note

    It shows that all three methods have the same accuracy (i.e. same result x=0.736et3x=0.736e^{t^3}). However, the efficiency is different. For an experience user, Exact Differential Equation is preferred due to its fast computation speed, for beginner it is recommended to use the Linear Separable Equation and Separable Differential Equation.

    v. dvdt3t2v+3t2=0,v(0)=2\frac{dv}{dt} -3t^{2} v+3t^{2} =0,\quad v(0) =2

    Solution
    • Dependent variable: vv

    • Independent variable: tt

    It is 1st order linear nonhomogeneous ordinary differential equation because dvdt3t2v=3t2non-zero forcing function\frac{dv}{dt} -3t^{2} v=\underbrace{-3t^{2}}_{\text{non-zero forcing function}}.

    Exact Differential EquationLinear Differential EquationSeparable Differential EquationBernoulli Differential Equation
    Not suitable because can’t find any formula that produce the derivate directly. To check there is exact solution or not use M(x,y)y=N(x,y)x\frac{\partial M( x,y)}{\partial y} =\frac{\partial N( x,y)}{\partial x}Suitable as it is linear ODEPossible because it is separable.Not possible. For nonlinear only

    Using Linear Differential Equation:

    Step 1: Arrange the differential equation in the linear form of dxdtp(t)x=q(t)\frac{dx}{dt} -p( t) x=q( t).

    dvdt3t2v+3t2=0  dvdt3t2v=3t2 \frac{dv}{dt} -3t^{2} v+3t^{2} =0\ \Longrightarrow \ \frac{dv}{dt} -3t^{2} v=-3t^{2}, where p(t)=3t2,q(t)=3t2p( t) =-3t^{2} ,\quad q( t) =-3t^{2}

    Step 2: Create integrating factor

    IF=ep(t)dt=e(3t2)dt=et3IF=e^{\int p( t) dt} =e^{\int \left( -3t^{2}\right) dt} =e^{-t^{3}}

    Step 3: Multiply 1st ODE eqn by IFIF

    IF(dvdt)IF(q(t)v)=IF(q(t))et3dvdt3t2et3v=3t2et3\begin{aligned} IF\left(\frac{dv}{dt}\right) -IF( q( t) v) & =IF( q( t))\\ e^{-t^{3}}\frac{dv}{dt} -3t^{2} e^{-t^{3}} v & =-3t^{2} e^{-t^{3}} \end{aligned}

    Step 4: Recognize the LHS is exact solution

    ddt(et3v)=3t2et3\frac{d}{dt}\left( e^{-t^{3}} v\right) =-3t^{2} e^{-t^{3}}

    Step 5: Integrate both side

    ddt(et3v)dt=(3t2f(x)et3f(x)) dtet3v=et3+C\begin{aligned} \int \frac{d}{dt}\left( e^{-t^{3}} v\right) dt & =\int \left(\underbrace{-3t^{2}}_{f'( x)}\underbrace{e^{-t^{3}}}_{f( x)}\right) \ dt\\ e^{-t^{3}} v & =e^{-t^{3}} +C \end{aligned}

    Given v(0)=2e03(2)=e03+CC=1v( 0) =2\Longrightarrow e^{-0^{3}}( 2) =e^{-0^{3}} +C \Longrightarrow C=1.

    et3v=et3+1v=1+et3\begin{aligned} e^{-t^{3}} v & =e^{-t^{3}} +1\\ \mathbf{v} & \mathbf{=1+e^{t^{3}}} \end{aligned}

    Using Seperable Differential Equation,

    dvdt=3t2v3t2dv(v1)=3t2dtlnv1=t3+Cgiven v(0)=2ln21=3+CC=0v=et3+1\begin{aligned} \frac{dv}{dt} &=3t^2v-3t^2\\ \int \frac{dv}{(v-1)} &= \int 3t^2dt\\ \ln \lvert v-1 \rvert &=t^3+C\qquad \text{given } v(0)=2\\ \ln \lvert 2-1 \rvert &=-^3+C\Rightarrow C=0\\ v&=e^{t^3}+1 \end{aligned}

    vi. dydt3ty=t2y3y+1,y(0)=0\frac{dy}{dt} -3ty=\frac{t^{2} y^{3}}{y+1} ,\quad y( 0) =0

    Solution
    • Dependent variable: yy

    • Independent variable: tt

    It is 1st order nonlinear ordinary differential equation because dydt3ty=t2y3y+1\frac{dy}{dt} -3ty=\frac{t^{2} y^{3}}{y+1} because dependent variable yy exist in RHS.

    Exact Differential EquationLinear Differential EquationSeparable Differential EquationBernoulli Differential EquationHomogeneous / Nonhomogeneous dydx=f(x,y)g(x,y)\frac{dy}{dx} =\frac{f( x,y)}{g( x,y)}
    Not suitable because can’t find any formula that produce the derivate directly. To check there is exact solution or not use M(t,x)t=N(t,x)x\frac{\partial M( t,x)}{\partial t} =\frac{\partial N( t,x)}{\partial x}Not suitable as it is nonlinear ODE.Not possible because it is non-separable.Not possible. For nonlinear only.Suitable for nonlinear.

    Using Homogeneous/ Nonhomogeneous:

    To check the homogeneity for 1st order nonlinear differential equation, we rearrange it to the dydx=f(t,y)g(t,y)\frac{dy}{dx} =\frac{f( t,y)}{g( t,y)} form, where dydt=t2y3y+1+3ty2+3tyy+1=t2y3+3ty2+3tyy+1\frac{dy}{dt} =\frac{t^{2} y^{3}}{y+1} +\frac{3ty^{2} +3ty}{y+1} =\frac{t^{2} y^{3} +3ty^{2} +3ty}{y+1}.

    f(λt,λy)g(λt,λy)=(λt)2(λy)3+3(λt)(λy)2+3(λt)(λy)(λy)+1\begin{aligned} \frac{f( \lambda t,\lambda y)}{g( \lambda t,\lambda y)} & =\frac{( \lambda t)^{2}( \lambda y)^{3} +3( \lambda t)( \lambda y)^{2} +3( \lambda t)( \lambda y)}{( \lambda y) +1} \end{aligned}

    Since f(t,y)f( t,y) and g(t,y)g( t,y) have different degree, therefore it is a nonhomogeneous equation.

    Solving 1st order ODE problem by using methods other than the five methods above is out of scope of this study.

    vii. x2d2ydx23ydydx=0,y(0)=1,y(2)=4 x^{2}\frac{d^{2} y}{dx^{2}} -3y\frac{dy}{dx} =0,\quad y( 0) =1,\quad y( 2) =4

    Solution
    • Dependent variable: yy

    • Independent variable: xx

    2nd order nonlinear ordinary differential equation because of nonlinear component 3y-3y. Boundary conditions are provided.

    viii. xdydx+y=8,y(0)=5x\frac{dy}{dx} +y=8,\quad y(0) =5

    Solution
    • Dependent variable: yy

    • Independent variable: xx

    1st order linear nonhomogeneous ordinary differential equation, xdydx+y=8forcing functionx\frac{dy}{dx} +y=\underbrace{8}_{\text{forcing function}}.

    We should recognize the LHS easily where it is an exact equation where ddx(xy)=xdydx+y\frac{d}{dx}( xy) =x\frac{dy}{dx} +y and it can be solved easily. Let us assume we do not know it is an exact equation & try with other.

    Using Linear Differential Equation:

    Step 1: Arrange the differential equation in the linear form of dydxp(x)y=q(x)\frac{dy}{dx} -p( x) y=q( x).

    xdydx+y=8  dydx+yx=8xx\frac{dy}{dx} +y=8\ \Longrightarrow \ \frac{dy}{dx} +\frac{y}{x} =\frac{8}{x}, where p(t)=1x,q(t)=8xp( t) =\frac{1}{x} ,\quad q( t) =\frac{8}{x}

    Step 2: Create integrating factor

    IF=ep(t)dt=e(1x)dt=elnx=xIF=e^{\int p( t) dt} =e^{\int \left(\frac{1}{x}\right) dt} =e^{\ln x} =x

    Step 3: Multiply 1st ODE eqn by $$IF$

    IF(dydx)IF(q(t)v)=IF(q(t))xdydx+y=8\begin{aligned} IF\left(\frac{dy}{dx}\right) -IF( q( t) v) & =IF( q( t))\\ x\frac{dy}{dx} +y & =8 \end{aligned}

    Step 4: Recognize the LHS is exact solution

    ddx(xy)=8\frac{d}{dx}( xy) =8

    Step 5: Integrate both side

    ddx(xy)dx=(8) dxxy=8x+Cy=8+Cx\begin{aligned} \int \frac{d}{dx}( xy) dx & =\int ( 8) \ dx\\ xy & =8x+C\\ y & =8+\frac{C}{x} \end{aligned}

    Given y(3)=55=8+C3C=9y( 3) =5\Longrightarrow 5 =8+\frac{C}{3} \Longrightarrow C=-9.

    y=89x\begin{aligned} \mathbf{y} & \mathbf{=8-\frac{9}{x}} \end{aligned}

    ix. dydt=y2+ytt2,y(1)=4\frac{dy}{dt} =\frac{y^{2} +yt}{t^{2}} ,\quad y( 1) =4

    Solution
    • Dependent variable: yy

    • Independent variable: tt

    1st order nonlinear ordinary differential equation dydty2+ytt2nonlinear=0\frac{dy}{dt} -\underbrace{\frac{y^{2} +yt}{t^{2}}}_{\text{nonlinear}} =0.

    Using Homogeneous/ Nonhomogeneous:

    To check the homogeneity for 1st order nonlinear differential equation, we rearrange it to the dydx=f(t,y)g(t,y)\frac{dy}{dx} =\frac{f( t,y)}{g( t,y)} form, where dydt=y2+ytt2\frac{dy}{dt} =\frac{y^{2} +yt}{t^{2}}.

    f(λt,λy)g(λt,λy)=(λy)2+(λy)(λt)(λt)2\begin{aligned} \frac{f( \lambda t,\lambda y)}{g( \lambda t,\lambda y)} & =\frac{( \lambda y)^{2} +( \lambda y)( \lambda t)}{( \lambda t)^{2}} \end{aligned}

    Since f(t,y)f( t,y) and g(t,y)g( t,y) are homogeneous equation with same degree, therefore it is a homogeneous equation.

    Let v=yt,y=vt,dydt=tdvdt+vv=\frac{y}{t} ,\quad y=vt,\quad \frac{dy}{dt} =t\frac{dv}{dt} +v

    1v=lnt+Cv=1lnt+Cyt=1lnt+CC=lntty\begin{aligned} -\frac{1}{v} & =\ln\vert t\vert +C\\ v & =-\frac{1}{\ln\vert t\vert +C}\\ \frac{y}{t} & =-\frac{1}{\ln\vert t\vert +C}\\ C & =-\ln\vert t\vert -\frac{t}{y} \end{aligned}

    Given y(1) = 4y( 1) \ =\ 4, we get C=lntty=ln114=14C =-\ln\vert t\vert -\frac{t}{y}=-\ln\vert 1\vert -\frac{1}{4} =-\frac{1}{4}

    Rearranging,

    y=tlnt+Cy=t14lnt\begin{aligned} y & =-\frac{t}{\ln\vert t\vert +C}\\ \mathbf{y} & \mathbf{=-\frac{t}{\frac{1}{4} -\ln\vert t\vert }} \end{aligned}

    x. 5xd3ydx34xdydx5tanx=0,y(0)=0,y(5)=4,y(10)=75x\frac{d^{3} y}{dx^{3}} -\frac{4}{x}\frac{dy}{dx} -5\tan x=0,\quad y( 0) =0,\quad y( 5) =4,\quad y( 10) =7

    Solution
    • Dependent variable: yy

    • Independent variable: tt

    3rd order linear nonhomogeneous ordinary differential equation where boundary conditions are provided, 5xd3ydx34xdydx=5tanxforcing function5x\frac{d^{3} y}{dx^{3}} -\frac{4}{x}\frac{dy}{dx} =\underbrace{5\tan x}_{\text{forcing function}}

  3. Solve

    i. dydx+2xy=4x\frac{dy}{dx}+2xy=4x

    Solution

    The integrating factor is given immediately by

    μ(x)=exp{2xdx}=expx2.\mu(x)=\exp \left\{\int 2 x d x\right\}=\exp x^2 .

    Multiplying through the ODE by μ(x)=expx2\mu(x)=\exp x^2 and integrating, we have

    yexpx2=4xexpx2dx=2expx2+c.y \exp x^2=4 \int x \exp x^2 d x=2 \exp x^2+c .

    The solution to the ODE is therefore given by y=2+cexp(x2)y=2+c \exp \left(-x^2\right).

    ii. dydx=2y3y2x\frac{dy}{dx}=-\frac{2}{y}-\frac{3y}{2x}

    Solution
    (4x+3y2)dx+2xydy=0,(1)\left(4 x+3 y^2\right) d x+2 x y d y=0, \tag{1}

    i.e. A(x,y)=4x+3y2A(x, y)=4 x+3 y^2 and B(x,y)=2xyB(x, y)=2 x y. Now

    Ay=6y,Bx=2y,\frac{\partial A}{\partial y}=6 y, \quad \frac{\partial B}{\partial x}=2 y,

    so the ODE is not exact in its present form. However, we see that

    1B(AyBx)=2x\frac{1}{B}\left(\frac{\partial A}{\partial y}-\frac{\partial B}{\partial x}\right)=\frac{2}{x}

    a function of xx alone. Therefore an integrating factor exists that is also a function of xx alone and, ignoring the arbitrary constant of integration, is given by

    μ(x)=exp{2dxx}=exp(2lnx)=x2.\mu(x)=\exp \left\{2 \int \frac{d x}{x}\right\}=\exp (2 \ln x)=x^2 .

    Multiplying (1) through by μ(x)=x2\mu(x)=x^2 we obtain

    (4x3+3x2y2)dx+2x3ydy=4x3dx+(3x2y2dx+2x3ydy)=0.\left(4 x^3+3 x^2 y^2\right) d x+2 x^3 y d y=4 x^3 d x+\left(3 x^2 y^2 d x+2 x^3 y d y\right)=0 .

    By inspection this integrates immediately to give the solution x4+y2x3=cx^4+y^2 x^3=c, where cc is a constant.

    iii. dydx=yx+tan(yx)\frac{dy}{dx}=\frac{y}{x}+\tan\left(\frac{y}{x}\right)

    Solution

    This is now a separable equation and can be integrated directly to give

    dvF(v)v=dxx(2)\int \frac{d v}{F(v)-v}=\int \frac{d x}{x} \tag{2}

    Substituting y=vxy=v x we obtain

    v+xdvdx=v+tanv.v+x \frac{d v}{d x}=v+\tan v .

    Cancelling vv on both sides, rearranging and integrating gives

    cotvdv=dxx=lnx+c1.\int \cot v d v=\int \frac{d x}{x}=\ln x+c_1 .

    But

    cotvdv=cosvsinvdv=ln(sinv)+c2,\int \cot v d v=\int \frac{\cos v}{\sin v} d v=\ln (\sin v)+c_2,

    so the solution to the ODE is y=xsin1Axy=x \sin ^{-1} A x, where AA is a constant.

    Notes

    Check to see whether the equation is homogeneous. If so, make the substitution y=vxy=v x, separate variables as in (2) and then integrate directly. Finally replace vv by y/xy / x to obtain the solution.

    :::