Examples of differential equations: Difference between revisions

Content deleted Content added
A more complicated model: Added syntax that doesn't make the newer MATLAB throw up with warnings
m formatting
Line 1:
'''[[Differential equation]]s''' arise in many problems in [[physics]], [[engineering]], and other sciences. The following examples show how to solve differential equations in a few simple cases when an exact solution exists.
 
== Separable first-order ordinary differential equations ==
{{see also|Separable partial differential equation}}
Equations in the form <math>\frac {dy}{dx} = f(x)g(y)</math> are called separable and are solved by <math>\frac {dy}{g(y)} = f(x)\,dx</math> and thus
<math>\int\frac {dy}{g(y)} = \int f(x)\,dx</math>. Prior to dividing by <math>g(y)</math>, one needs to check if there are stationary (also called equilibrium)
solutions <math>y=\text{const}</math> satisfying <math>g(y)=0</math>.
 
==Separable (homogeneous) first-order linear ordinary differential equations==
{{see also|Separable partial differential equation}}
A separable ''[[linear ordinary differential equation|linear]]'' [[ordinary differential equation]] of the first order must be [[homogeneous differential equation|homogeneous]] and has the general form
must be homogeneous and has the general form
 
:<math>\frac{dy}{dt} + f(t) y = 0</math>
Line 18 ⟶ 17:
:<math>\frac{dy}{y} = -f(t)\, dt</math>
 
Since the separation of variables in this case involves dividing by ''y'', we must check if the constant function ''y=0''=0 is a solution of the original equation. Trivially, if ''y''=0'' then ''yy′''=0'', so ''y''=0'' is actually a solution of the original equation. We note that ''y=0''=0 is not allowed in the transformed equation.
 
We solve the transformed equation with the variables already separated by [[Integralintegral Calculuscalculus|Integratingintegrating]],
 
:<math>\ln |y| = \left(-\int f(t)\,dt\right) + C</math>
Line 28 ⟶ 27:
:<math>y = \pm e^{\left(-\int f(t)\,dt\right) + C} = \pm e^{C} e^{-\int f(t)\,dt}</math>.
 
Here, <math>e^{C}>0</math>, so <math>\pm e^{C}\neq 0</math>. But we have independently checked that ''y=0''=0 is also a solution of the original equation, thus
:<math>y = A e^{-\int f(t)\,dt}</math>.
with an arbitrary constant ''A'', which covers all the cases. It is easy to confirm that this is a solution by plugging it into the original differential equation:
Line 34 ⟶ 33:
:<math>\frac{dy}{dt} + f(t) y = -f(t) \cdot A e^{-\int f(t)\,dt} + f(t) \cdot A e^{-\int f(t)\,dt} = 0</math>
 
Some elaboration is needed because ''&fnof;''(''t'') might not even be [[integrable function|integrable]]. One must also assume something about the [[___domain of a function|domains]] of the functions involved before the equation is fully defined. The solution above assumes the [[real number|real]] case.
 
If <math>f(t)=\alpha</math> is a constant, the solution is particularly simple, <math>y = A e^{-\alpha t}</math> and describes, e.g., if <math>\alpha>0</math>, the exponential decay of radioactive material at the macroscopic level. If the value of <math>\alpha</math> is not known a priori, it can be determined from two measurements of the solution. For example,
Line 43 ⟶ 42:
 
==Non-separable (non-homogeneous) first-order linear ordinary differential equations==
First-order linear non-homogeneous ODEs (ordinary [[ordinary differential equation]]s (ODEs) are not separable. They can be solved by the following approach, known as an ''[[integrating factor]]'' method. Consider first-order linear ODEs of the general form:
 
:<math>\frac{dy}{dx} + p(x)y = q(x)</math>
Line 59 ⟶ 58:
:<math>\mu{\frac{dy}{dx}} + \mu{p(x)y} = \mu{q(x)}</math>
 
Because of the special ''&mu;'' we picked, we may substitute ''d&mu;''/''dx'' for ''&mu;''&nbspthinsp;''p''(''x''), simplifying the equation to:
 
:<math>\mu{\frac{dy}{dx}} + y{\frac{d{\mu}}{dx}} = \mu{q(x)}</math>
Line 71 ⟶ 70:
:<math>\mu{y} = \left(\int\mu q(x)\, dx\right) + C</math>
 
Finally, to solve for ''y'' we divide both sides by <math>\''&mu</math>;'':
 
:<math>y = \frac{\left(\int\mu q(x)\, dx\right) + C}{\mu}</math>