Displaying posts published in

July 2012

Fourier Series

Let \(f\) be a piecewise continuous function on the interval \([-T,T]\).  The Fourier Series of \(f\) is the trigonometric series

\[f(x)\sim\frac{a_0}{2}+\sum_{n=1}^\infty \left\{a_n\cos\left(\frac{n\pi x}{T}\right)+b_n\sin\left(\frac{n\pi x}{T}\right)\right\}\]

where the \(a_n\)'s and \(b_n\)'s are given by the formulas

\[a_n=\frac{1}{T}\int_{-T}^Tf(x)\cos\left(\frac{n\pi x}{T}\right)dx\; , \; n=0,1,2,...\]

\[b_n=\frac{1}{T}\int_{-T}^Tf(x)\sin\left(\frac{n\pi x}{T}\right)dx\; , \; n=1,2,3,...\]

For example, let \(f(x)\) be defined by $$!f(x)=\begin{cases} 0 & , […]

Fun with Trigonometry

\[\ddot{x}+x=0.5\cos(0.8x)\]

The homogeneous solution is

\[x_h(t)=c_1\cos(t)+c_2\sin(t)\]

Using variation of parameters we get a nonhomogeneous solution of

\[x_p(t)=\left(\frac{5}{4}\cos(0.2t)+\frac{5}{36}\cos(1.8t)\right)\cos(t)+\left(\frac{5}{4}\sin(0.2t)+\frac{5}{36}\sin(1.8t)\right)\sin(t)\]

Distributing and regrouping

\[x_p(t)=\frac{5}{4}\cos(t)\cos(0.2t)+\frac{5}{4}\sin(t)\sin(0.2t)+\frac{5}{36}\cos(1.8t)\cos(t)+\frac{5}{36}\sin(1.8t)\sin(t)\]

Reversing the cosine angle difference formula

\[x_p(t)=\frac{5}{4}\cos(0.8t)+\frac{5}{36}\cos(0.8t)=\frac{25}{18}\cos(0.8t)\]

Using the initial conditions \(x(0)=0\), \(\dot{x}(0)=0\), we get \(c_1=\frac{-25}{18}\) and \(c_2=0\) So a specific solution is

\[x(t)=\frac{-25}{18}\cos(t)+\frac{25}{18}\cos(0.8t)\]

\[x(t)=\frac{25}{18}\left(\cos(0.8t)-\cos(t)\right)\]

Regrouping and applying a difference to product formula

\[x(t)=\frac{25}{18}\left(2\sin\left(\frac{1-0.8}{2}\right)\sin\left(\frac{1+0.8}{2}\right)\right)\]

[…]

Bernoulli Equations

Bernoulli equations are of the form:

\[\frac{dy}{dx}+P(x)y=Q(x)y^n\]

Dividing by \(y^n\):

\[\frac{dy}{dx}y^{-n}+P(x)y^{1-n}=Q(x)\]

If \(n=0\) or \(n=1\) then the equation is linear.  Otherwise a substitution of \(u=y^{1-n}\) will give us a linear equation. If \(u=y^{1-n}\), then \(\frac{du}{dx}u=(1-n)\frac{dy}{dx}y^{-n}\).  Substituting these into the second equation from above:

\[\frac{1}{1-n}\frac{du}{dx}+P(x)u=Q(x)\]

For example,

\[y'+2xy=xy^4\]

Dividing by \(y^4\), we get  \(y'y^{-4}+2xy^{-3}=x\) Substituting \(u=y^{-3}\) […]

Homogeneous First-order Equations

There are two ways to view "homogeneous" first-order ordinary differential equations. 1. \(\frac{dy}{dx}=f(x,y)\) is a general first order ordinary differential equation.  If the function on the right, \(f(x,y)\), can be rewritten as a function of \(\frac{y}{x}\), e.g. \(f(x,y)=\frac{y-2x}{x}\) can be rewritten as \(g\left(\frac{y}{x}\right)=\frac{y}{x}-2\).  If we let \(v=\frac{y}{x}\), then we would have \(g(v)=v-2\). In general, the […]