# Differential Equations

## What are Differential Equations?

Equation involving a function and one or more of its derivatives. If function has only 1 independent var it is ordinary differential equation

Examples of Differential Equations:

1. $\frac{dy}{dx}=-7x\,\,\,\,\frac{dy}{dx}=\sin x$
2. $\left( \frac{d{{y}^{2}}}{d{{x}^{2}}} \right)-6\frac{dy}{dx}+8y=0$

Differential equation involving a function of several variables of its partial derivatives is called partial differential equation.

### Order and degree of Differential equations

• Order: Highest differential coefficient
• Degree: Differential equation when expressed as [Polynomial in the derivatives] is the power of highest order derivative
$f\left( xy \right)\frac{{{d}^{m}}y}{d{{x}^{m}}}+g\left( xm \right)\frac{{{d}^{m-1}}y}{d{{x}^{m-1}}}+…=0$

Degree may not be defined at ways:

• $y’+6{{y}^{2}}+y=0\,\,\left( 1,1 \right)$
• ${{\left( y’ \right)}^{2}}+{{y}^{2}}-1=0\,\,\,\left( 1,2 \right)$
• $y”+{{\left( 2{{y}^{1}} \right)}^{6}}+\sin y=0\,\,\,\left( 2,1 \right)$ $y”+\sin \left( y’ \right)+y=0\,\,\left( 2,ND \right)$
• $y’+\sin y’=0\,\,\,\left( 1,ND \right)$

### Formation of Differential Equation

For family of curves

$f\left( x,y,\alpha ,{{\alpha }_{2}}….{{\alpha }_{n}} \right)=0$ … (1)

Where $\alpha ,{{\alpha }_{2}}…{{\alpha }_{n}}$ are n different parameters. If we differentiate n times, we get differential equation of the given equation (1).

e.g. Q. Form differential equation of all lines passing through origin.

$y=mx$

⇒ $\frac{dy}{dx}=m$

∴ xdy – ydx = 0 is answer.

## Solution of Differential Equations

The solution of differential equation is the Relation between the variables involved which satisfies differential equation.

Types of solutions:

1. General solution:

It contains as many as arbitrary constants as the order of the differential equation.

2. Particular solution

The solution obtained by giving particular values to the arbitrary constants in the general solution of differential equation.

4 methods for solving the differential equation

1. Variable separable
2. Homogeneous
3. Linear differential equation
4. General

### Variable separable Method

If equation can be written such that variables are separated for integration then equation can be solved.

We get $\int{f\left( x \right)dx+\int{g\left( y \right)dy=c}}$

Illustration

Solve $\log \left( \frac{dy}{dx} \right)=4x-2y-2$ given y = 1 when x = 1

$\frac{dy}{dx}={{e}^{4x-2y-2}}$ given

$\int{{{e}^{2y+2}}dy=\int{{{e}^{4x}}dx}}$ $\frac{{{e}^{2y+2}}}{2}=\frac{{{e}^{4x}}}{4}+c$ put x = 1 y = 1

$\frac{{{e}^{4}}}{2}=\frac{{{e}^{4}}}{4}+c\,\,or\,\,\frac{{{e}^{4}}}{4}$ $2{{e}^{2y+2}}={{e}^{4x}}+{{e}^{4}}$

### Homogenous Differential Equation

A differential equation of form $\frac{dy}{dx}=\frac{f\left( x,y \right)}{\phi \left( x,y \right)}$ where $f\And \phi$ are homogeneous is called as homogenous.

Homogenous function: The function (x, y) is called functions. So, if

$f\left( \lambda x,\lambda y \right)={{\lambda }^{n}}f\left( x,y \right)$

Thus homogenous function can be written as $f\left( x,y \right)={{x}^{n}}f\left( \frac{y}{x} \right)$ or $f\left( x,y \right)={{y}^{n}}f\left( \frac{y}{x} \right)$

Homogeneous differential equations

In first order first degree differential equation is expressed in form.

$\frac{dy}{dx}=\frac{f\left( x,y \right)}{g\left( x,y \right)}$

Example: Solve differential equation ${{x}^{2}}dy+y\left( x+y \right)dx=0$ y = 1 when x = 1.

Solution:

${{x}^{2}}+dy+y\left( x+y \right)dx=0$ ${{x}^{2}}+dy=-y\left( x+y \right)dx$ $\frac{dy}{dx}=\frac{-y\left( x+y \right)}{{{x}^{2}}}$

Since each xy + y2 and x2 is homogeneous putting

$y=vx$ $\frac{dy}{dx}=v+x\frac{dv}{dx}$ $v+x\frac{dv}{dx}=-\left( \frac{v{{x}^{2}}+{{v}^{2}}{{x}^{2}}}{{{x}^{2}}} \right)$ $v+x\frac{dv}{dx}=-\left( v+{{v}^{2}} \right)$ $\int{\frac{1}{{{v}^{2}}+2v}dv=-\int{\frac{1}{x}}}$ $\frac{1}{2}\log \left| \frac{v+1-1}{v+1+1} \right|=-\log x+\log c$ $\log \left| \frac{v}{v+2} \right|+2\log x=2\log c$ $\log \left| \frac{v{{x}^{2}}}{v+2} \right|=2\log k$ $k=\left| \frac{v{{x}^{2}}}{v+2} \right|$ $k=\left| \frac{{{x}^{2}}y}{y+2x} \right|$

Put y = 1 & x = 1

$k=\frac{1}{3}$ $3{{x}^{2}}=y+2x$ $y=\frac{2x}{3{{x}^{2}}-1}$ which is a required solution.

Example: Solve ${{x}^{2}}ydx-\left( {{x}^{3}}+{{y}^{3}} \right)dy=0$

Solution:

$\frac{dy}{dx}=\frac{{{x}^{2}}y}{{{x}^{3}}+{{y}^{3}}}$

Putting y = vx and $\frac{dy}{dx}=v+x\frac{dv}{dx}$ $v+x\frac{dv}{dx}=\frac{v{{x}^{3}}}{{{x}^{3}}+{{v}^{3}}{{x}^{3}}}$

= $\frac{v{x}^{3}}{{x}^{3}\left( 1+{v}^{3} \right)}$

= $\frac{v}{\left( 1+{{v}^{3}} \right)}$ $x\frac{dv}{dx}=\frac{v}{1+{{v}^{3}}}-v$ $x\left( 1+{{v}^{3}} \right)dv=-{{v}^{4}}dx$ $\left( \frac{1+{{v}^{3}}}{{{v}^{4}}} \right)dv=\frac{-dx}{x}$ $-\frac{1}{3{{v}^{3}}}+\log \left| v \right|+\log \left| x \right|=c$ $-\frac{1}{3}\frac{{{x}^{3}}}{{{y}^{3}}}+\log \left| \frac{y}{x}.\,x \right|=c$ $\frac{-{{x}^{3}}}{3{{y}^{3}}}+\log \left| y \right|=c$ is the required solution.

We solve by $y=tx$ & proceeding accordingly.

Example: $x\sin \left( \frac{y}{x} \right)dy=\left( y\sin \left( \frac{y}{x} \right)-x \right)dx$

Put $y=tx$

∴ $\,\,\sin t\left( t+\frac{xdt}{dm} \right)=t\sin t-1$ $\sin t\frac{xdt}{dx}=-1$ $\int{\sin t\,dt}=-\int{\frac{dx}{x}}$ $\cos t={{\log }_{e}}x+c$ $\cos \left( \frac{y}{x} \right)={{\log }_{e}}x+c$

### Linear Differential Equation

Equation of form $\frac{dy}{dx}+py=\theta$.

Linear differential equation: A differential equation is linear if the dependent variable (y) and its derivative appear only in first degree.

The general form of linear differential equation of first order is $\frac{dy}{dx}+Py=Q$, P, Q are constants.

We solve such type of equation by multiplying both sides ${{e}^{\int{Pdx}}}$ ${{e}^{\int{Pdx}}}\left( \frac{dy}{dx}+Py \right)=Q\,{{e}^{\int{Pdx}}}$ $\frac{d}{dx}\left\{ y\,{{e}^{\int{Pdx}}} \right\}=Q\,{{e}^{\int{Pdx}}}$

Integrating both sides

$y\,{{e}^{\int{Pdx}}}=\int{\,Q\,\,{{e}^{\int{Pdx}}}dx+c}$

Here,

${{e}^{\int{Pdx}}}$ is called integrating factor.

$y[I.F]=\int{Q\,(I.F)dx+c}$

solve by multiplying integrating function

If ${{e}^{\int{pdx}}}$

To get final solution of

$y(if)=\int{Q(IF)+c}$

Illustration: Solve ${{x}^{2}}\frac{dy}{dx+y+1}=1$

Ans : Given equation is

$\frac{dy}{dx}+\frac{1}{{{x}^{2}}}y=\frac{1x}{{{x}^{2}}}$which is linear

$p=\frac{1}{{{x}^{2}}},q=\frac{1}{{{x}^{2}}}$

IF$={{e}^{\int{\frac{1}{{{x}^{x}}}dx}}}=e\frac{1}{x}$

Ans:

$y\,e\,\frac{-1}{x}=\int{{{p}^{\frac{-1}{{{x}^{2}}}}}}(\frac{1}{{{x}^{2}}})dx+c$ $y=1+c{{e}^{\frac{1}{x}}}$

## Applications of Differential Equations

Illustration:

Find if slope of curve passing through (3, 4) is reciprocal of twice of the ordinate of the point.

Given $\frac{dy}{dx}=\frac{1}{2y}$.

$2ydy=dx\Rightarrow {{y}^{2}}=x+c$ $\left( 3,4 \right)\rightarrow{{}}c=13$ ${{y}^{2}}=x+13$

### 1st order Differential equation

$\frac{dN}{dt}=kN$

1. Biologist, at t = 0 puts 100 bacteria, in favourable growth medium, 6 hrs later it became 450. Assume exponential growth find growth const k.

$A=P{{e}^{kt}}$ $450=100{{e}^{6k}}$

∴ $k=\frac{\ell n\,4.5}{6}$

Population and Number of people

Q. If after 2 years population has doubled & after 3 years the population is 20k, find the no of people initially living.

$k=\frac{1}{2}\ell n\,2$ $No=\frac{20k}{2\sqrt{2}}=7071$

Q. 5 mice in stable population of 500 are infected with disease test a theory which says rate of change of infected population is α product of diseased one & disease free.

How long it takes for half the population to contract the disease?

$\frac{dN}{dt}=k\,\,\,N\left( 500-N \right)$ $\ell n\left( \frac{N}{500-N} \right)=500\left( kt+c \right)$ $\frac{N}{500-N}={{c}_{1}}\,\,{{e}^{500kt}}\,\,\,t=0\,\,\,N=5$ $\frac{5}{495}={{c}_{1}}{{e}^{500k\left( 0 \right)}}\Rightarrow {{c}_{1}}=\frac{1}{99}$

∴ $\frac{N}{500-N}=\frac{1}{99}\,{{e}^{500kt}}$ $N=250\Rightarrow 1=\frac{1}{99}{{e}^{500k{{T}_{1/2}}}}$ ${{T}_{1/2}}=\frac{\ell n\left( 99 \right)}{500k}=\frac{0.0091}{k}$ time units.

Newton’s cooling law

Time rate of change of temp of a body is α to temp difference between body & its surrounding medium

$\frac{dT}{dt}=-k\left( T-{{T}_{m}} \right)$ ${{T}_{m}}\to$ Surrounding temp

Cooling produces $\frac{dT}{dt}\to -$ve T greater than Tm.

Q. A metal bar at 100°F at room temp 0°F if after 20 min, temp of bar is 50°F.

(a) Time to reach 25°F

(b) Temp after 10 min.

$\frac{dT}{dt}=-k\left( T-{{T}_{m}} \right)\Rightarrow \frac{dT}{dt}+kT=0$ ${{T}_{m}}=0$ $T=c{{e}^{-kt}}$

T = 100 at t = 0

∴ $c=100\,{{e}^{k0}}$ $T=100\,{{e}^{-kt}}$

At t = 20 T = 50

∴ $\frac{1}{2}={{e}^{-k\,20}}\,\,\,\,\,\frac{\ell n2}{20}=k$

∴ $(a)\,\,\,25=100\,\,{{e}^{-\frac{\ell n2}{20}t}}$ $\ell n\,4=\frac{\ell {{n}^{2}}}{20}t\,\,\,\,\,\,\,\,t=40$

(b) $T=100{{e}^{-\frac{\ell n2}{20}\times 10}}=\frac{100}{\sqrt{2}}=70.71{}^\circ F$

### Solutions of First Order and First Degree Differential Equation

Methods of solving

1. Differential equation is form of $\frac{dy}{dx}=f\left( x \right)$ In this we integrate both sides to get general solutions.

Example:

$\frac{dy}{dx}=\frac{x}{{{x}^{2}}+1}$

Solution:

$dy=\left( \frac{x}{{{x}^{2}}+1} \right)dx$ $\int{dy}=\int{\frac{xdx}{{{x}^{2}}+1}}$ $\int{dy}=\frac{1}{2}\int{\frac{2x\,\,dx}{{{x}^{2}}+1}}$ $y=\frac{1}{2}\log \left| {{x}^{2}}+1 \right|+c\,\,\,\,\,\,\,\,x\varepsilon R$ is the solution of given differential equation

Example:

$\frac{dy}{dx}=\frac{3{{e}^{2x}}+3{{e}^{4x}}}{{{e}^{x}}+{{e}^{-x}}}$

Solution:

$\frac{dy}{dx}=\frac{3{{e}^{2x}}+3{{r}^{4x}}}{{{e}^{x}}+\frac{1}{{{e}^{x}}}}=\frac{3{{e}^{2x}}\left( 1+{{e}^{2x}} \right)}{{{e}^{x}}+\frac{1}{{{e}^{x}}}}$ $\frac{dy}{dx}=3{{e}^{3x}}$ $\int{dy}=\int{3{{e}^{3x}}dx}$ $y=3\left( \frac{{{e}^{3x}}}{3} \right)+c$ is required solutions.

### Types of Differential equation

• $\frac{dy}{dx}=f\left( y \right)$ we integrate both the sides to get general solutions.
• $\frac{dy}{dx}=f\left( y \right)$
• $\frac{dx}{dy}=\frac{1}{f\left( y \right)}f\left( y \right)\ne 0$
• $dx=\frac{dy}{d\left( y \right)}$
• $x=\int{\frac{dy}{f\left( y \right)}}+c$

Equation reducible to variable separable form

Differential equation in form of:- $\frac{dy}{dx}=f\left( ax+by+c \right)$ can be reduced to variable separable form by substitution ax + by + c = v.

### Practice Problems on Differential Equations

Example: Solve $\frac{dy}{dx}+y=1$

Solution:

$\frac{dy}{dx}=1-y$ $\frac{dx}{dy}=\frac{1}{1-y}$ $\int{dx}=\int{\frac{dy}{1-y}}$

x = – log | 1 – y | + c is required solution

Example: Solve $\frac{dy}{dx}=\sec y$

Solutions:

$\frac{dx}{dy}=\frac{1}{\sec y}=\cos y$ $\int{dx}=\int{\cos \,y\,dy}$

x = sin y + c is required solutions.

1. Equation is variable separable form we integrate both the sides and solutions is given by
$\int{f\left( x \right)\,}dx=\int{g\left( y \right)\,}dy+c$

Example: Solve $\left( x+1 \right)\frac{dy}{dx}=2xy$

Solutions:

$\left( x+1 \right)dy=2xy\,\,dx$ $\frac{dy}{y}=\frac{2x\,dx}{x+1}$ $\frac{dy}{y}=\frac{2x\,\,dx}{x+1}$ $\int{\frac{dy}{y}}=\int{\frac{2x\,\,dx}{\left( x+1 \right)}}$ $\log \,y=2\left\{ x-\log \left| x+1 \right| \right\}+c$ is the solutions.

Example: Solve ${{e}^{x}}\sqrt{1-{{y}^{2}}\,}dx+\frac{y}{x}dy=0$

Solutions:

$x{{e}^{x}}dx=\frac{-y}{\sqrt{1-{{y}^{2}}}}dy$

Apply product rule of integration

$x{{e}^{x}}-\int{{{e}^{x}}}dx=\frac{1}{2}\int{\frac{dt}{\sqrt{t}}}t=1-{{y}^{2}}$ $x{{e}^{x}}-{{e}^{x}}=\sqrt{t}+c$ $x{{e}^{x}}-{{e}^{x}}=\sqrt{1+{{y}^{2}}}+c$ is the required solutions.

Example: Solve $\frac{dy}{dx}={{e}^{x+y}}$

Solution:

$\frac{dy}{dx}={{e}^{x}}{{e}^{y}}$ $dy={{e}^{x}}.{{e}^{y}}.dx$ $\frac{dy}{{{e}^{y}}}={{e}^{x}}\,dx$ $\int{{{e}^{-y}}}\,dy=\int{{{e}^{x}}}dx$ $\frac{{{e}^{-y}}}{-1}={{e}^{x}}+C$ $-{{e}^{-y}}={{e}^{x}}+C$

Example: Solve $\frac{dy}{dx}=\cos \left( x+y \right)$

Solution:

x + y = v

$1+\frac{dy}{dx}=\frac{dv}{dx}$ $\frac{dv}{dx}=-1$

Put these value in given D.E

$\frac{dv}{dx}-1=\cos \,v$ $\frac{dv}{dx}=1+\cos v$ $\frac{dv}{1+cos\;v}=dx$

Integrating both sides

$\tan \frac{v}{2}=x+c$ $\tan \left( \frac{x+y}{2} \right)=x+c$ is the required solutions.

Example: Solve ${{\left( x+y \right)}^{2}}\frac{dy}{dx}={{a}^{2}}$

Solution:

x + y = v

Then $\frac{dy}{dx}+1=\frac{dv}{dx}$ $\frac{dv}{dx}=\frac{dy}{dx}+1\Rightarrow \frac{dv}{dx}-1=\frac{dy}{dx}$

Put these in D.E ${{V}^{2}}\left( \frac{dv}{dx}-1 \right)={{a}^{2}}$ ${{v}^{2}}\frac{dv}{dx}-{{v}^{2}}={{a}^{2}}$ ${{v}^{2}}\frac{dv}{dx}={{a}^{2}}+{{v}^{2}}$ $\int{\left( \frac{{{V}^{2}}}{{{a}^{2}}+{{v}^{2}}} \right)}dv=\int{dx}$ $v-a\,{{\tan }^{-1}}\left( \frac{v}{a} \right)=x+c$ $\left( x+y \right)-a{{\tan }^{-1}}\left( \frac{x+y}{a} \right)=x+C$ is a required solutions.

Example: Solve $\frac{dy}{dx}-\frac{y}{x}=2{{x}^{2}}$

Solution:

$\frac{dy}{dx}+\left( -\frac{1}{x} \right)y=2{{x}^{2}}$ $P=\frac{-1}{x}\,\,and\,\,Q=2{{x}^{2}}$

Multiply both sides by I.F

I.F $={{e}^{\int{Pdx}}}={{e}^{\int{\frac{-1}{x}dx}}}={{e}^{-\log x}}$ $={{e}^{\log {{x}^{-1}}}}$ $={{x}^{-1}}=\frac{1}{x}$ $\frac{1}{x}\frac{dy}{dx}-\frac{1}{{{x}^{2}}}y=2x$

Integrating both sides w.r.t. x we get

$y\left( \frac{1}{x} \right)=\int{2x\,dx+c}$ $\frac{y}{x}={{x}^{2}}+c$ $y={{x}^{3}}+cx$ is required solution.

Example: $\left( {{x}^{2}}-1 \right)\frac{dy}{dx}+2xy=\frac{1}{{{x}^{2}}-1}$

Solution:

$\left( {{x}^{2}}-1 \right)\frac{dy}{dx}+2xy=\frac{1}{{{x}^{2}}-1}$ $\frac{dy}{dx}+\left( \frac{2x}{{{x}^{2}}-1} \right)y=\frac{1}{{{\left( {{x}^{2}}-1 \right)}^{2}}}$ $P=\frac{2x}{{{x}^{2}}-1}\,\,\,\,Q=\frac{1}{{{\left( {{x}^{2}}-1 \right)}^{2}}}$

I.F $={{e}^{\int{Pdx}}}={{e}^{\int{\frac{2x}{{{x}^{2}}-1}dx}}}={{e}^{\log \left( {{x}^{2}}-1 \right)}}={{x}^{2}}-1$

Multiplying both sides by I.F

$\left( {{x}^{2}}-1 \right)\frac{dy}{dx}+2xy=\frac{1}{{{x}^{2}}-1}$ $y\left( {{x}^{2}}-1 \right)=\int{\frac{1}{{{x}^{2}}+1}dx+c}$ $y\left( {{x}^{2}}-1 \right)=\frac{1}{2}\log \left| \frac{x-1}{x+1} \right|+c.$ is the required solution.

Example: Show that $y=a{{e}^{2x}}+b{{e}^{-x}}$ is a solution of differential equation $\frac{{{d}^{2}}y}{d{{x}^{2}}}-\frac{dy}{dx}-2y=0.$

Solution:

$y=a{{e}^{2x}}+b{{e}^{-x}}$ $\frac{dy}{dx}=2a{{e}^{2x}}-b{{e}^{-x}}$ $\frac{{{d}^{2}}y}{d{{x}^{2}}}=4a{{e}^{2x}}+b{{e}^{-x}}$ $\frac{{{d}^{2}}y}{d{{x}^{2}}}-\frac{dy}{dx}-2y=4a{{e}^{2x}}+b{{e}^{-x}}-2a{{e}^{2x}}+b{{e}^{-x}}-2\left( a{{e}^{2x}}+b{{e}^{-x}} \right)$

= 0

Hence it satisfies the differential equation.

Example: Show that $y=cx+\frac{c}{a}$ is solution of differential equation, $y=x\frac{dy}{dx}+\frac{a}{\frac{dy}{dx}}.$

Solution:

$y=cx+\frac{c}{a}$ $\frac{dy}{dx}=c$ $x\frac{dy}{dx}+\frac{a}{\frac{dy}{dx}}=xc+\frac{a}{c}=y$

This satisfies the differential equation hence is a solution.

Note:

$y=A\cos x+B\sin x$ is general solutions of differential equation $\frac{{{d}^{2}}y}{d{{x}^{2}}}+y=0$

But,

y = A cos x is not general solution as it contains only one arbitrary constant.