Showing posts with label solution. Show all posts
Showing posts with label solution. Show all posts

Monday, May 7, 2012

Compute the Taylor series for x^4-3x^2+1 around a=1

Compute the Taylor series for $f(x) = x^4-3x^2+1$ around $a=1$.

Method 1 Take derivatives.

Step 1: Determine the series coefficients.

Step 1a: Evaluate the function at 1.
$f(1) = -1$

Step 1b: Take the first derivative and evaluate it at 1.
$f^{\prime}(x) = 4x^3-6x$
$f^{\prime}(1) = -2

Step 1c: Take the second derivative and evaluate it at 1.
$f^{\prime\prime}(x) = 12x^2-6$
$f^{\prime\prime}(1) = 6

Step 1d: And so on...
$f^{\prime\prime\prime}(x) = 24x$
$f^{\prime\prime\prime}(1) = 24$
$f^{\prime\prime\prime\prime}(x) = 24$
$f^{\prime\prime\prime\prime}(1) = 24$

Step 2: Lay out the coefficients in front of the appropriate power of $(x-a)$ and divide by the corresponding factorial.
For example, the coefficient of $(x-1)^2$ is the evaluation of the second derivative (2) divided by the factorial of two.

In tabular form we have the following:
CoefficientFactorialx termAll Together
$f^{(0)}(1)=f(1)$0!$(x-1)^0$$\frac{-1}{0!}$
$f^{(1)}(1)=f^{\prime}(1)$1!$(x-1)^1$$\frac{-2}{1!}(x-1)$
$f^{(2)}(1)=f^{\prime\prime}(1)$2!$(x-1)^2$$\frac{6}{2!}(x-1)^2$
$f^{(3)}(1)=f^{\prime\prime\prime}(1)$3!$(x-1)^3$$\frac{24}{3!}(x-1)^3$
$f^{(4)}(1)=f^{\prime\prime\prime\prime}(1)$4!$(x-1)^4$$\frac{24}{4!}(x-1)^4$

At the end of the day we have $$-1-2(x-1)+3(x-1)^2+4(x-1)^3+(x-1)^4$$

[20120507]

Method 2 Potentially the easiest method provided it's allowed by the instructor.

First we recognize that $f$ can be written as $((x-1)+1)^4-3((x-1)+1)^2+1$.

Then we expand the terms to obtain $((x-1)^4+4(x-1)^3+6(x-1)^2+4(x-1)+1$ from the first term, $-3((x-1)^2+2(x-1)+1)$ from the second term, and $1$.

Simplifying we get $(x-4)^4+4(x-1)^3+3(x-1)^2-2(x-1)-1$.

[20191223]

Method 3 Theoretical method; arguably harder.

We know the coefficient of $(x-1)^4$ must be 1, because it is the only term that contributes to the highest degree term of $f$.

We expand $(x-1)^4$ to get x^4-4x^3+6x^2-4x+1 (I computed the expansion with the help of Pascal's triangle).

There are no powers of $x^3$ in $f$ so we need to offset it with $4(x-1)^3$. The expansion here is $4(x^3-3x^2+3x-1)$ or $4x^3-12x^2+12x-4$.

Keeping track we have $-6x^2+8x-3$ to worry about. So we add $3(x-1)^2$. The expansion here is $3(x^2-2x+1)$ or $3x^2-6x+3$.

The remaining amount to worry about is $2x$. So we add $-2(x-1)$ or $-2x+2$.

The remaining about to worry about is $2$. So we add $-1$.

Remark: Throughout this method, I use the term "add." It's useful to think in terms of adding negative "x" instead of subtracting "x." My high school teacher taught my fellow students and me that subtraction (Satan) and division (Devil) are evil and so we should instead "add a negative" and "multiply by the inverse," respectively.

[20191223]

Thursday, February 2, 2012

Integral of x*exp(x)*cos(x) with respect to x

This post is a follow-up to Useful Mnemonic: DETAIL where the problem was posed.

Determine $f(x)=\int x e^x \cos (x)dx$.

CHOICE A (Suggested by DETAIL):
Let $u=x\cos(x)$ and $dv= e^x dx$.
Then $du=\cos(x)-x\sin(x)dx$ and $v=e^x$.
Then $f(x)=x\cos(x)e^x - \int e^x \left[ \cos(x)-x\sin(x) \right] dx$

CHOICE B:
Let $u=x e^x$ and $dv=\cos(x)dx$.
Then $du = e^x+x e^x dx$ and $v=\sin(x)$.
Then $f(x)=x e^x \sin(x) - \int \sin(x) \left[ e^x +x e^x\right] dx$

CHOICE C:
Let $u=e^x$ and $dv=x \cos(x)dx$.
Then $du = e^x dx$ and $v=\int x\cos(x)dx$
Let $\hat{u}=x$ and $d\hat{v}=\cos(x)dx$.
Then $\hat{v}=\sin(x)$
Then $\int x\cos(x)dx = x \sin(x)- \int\sin(x)dx = x\sin (x)+\cos(x) +\hat{C}$
We only concern ourself with a particular $v$, so we assume $\hat{C}=0$.
Then $f(x) = e^x \left[ x\sin(x) + \cos (x) \right] -\int \left[x\sin(x)+\cos(x) \right] e^x dx$

What remarks can we make? For this specific problem, regardless of the above three choices for $u$ and $dv$, we will have to do integration by parts again. DETAIL recommended choice A, but choice B was just as short. Though as a personal opinion, I find it easier to make sign errors when determining antiderivatives to trigonometric functions than when determining antiderivatives to exponential functions.

Recall that $\frac{d}{dt} \sin (t) = \cos (t)$, while $\frac {d}{dt} \cos (t)=-\sin(t)$.

Saturday, April 2, 2011

Homework Week 7 Solutions

pg 359 \#1.

Let $x_{1}=u$, $x_{2}=u^{\prime}$

Then

$x_{1}^{\prime}=x_{2}$,

$x_{2}^{\prime}=u^{\prime\prime}=-0.5u^{\prime}-2u=-0.5x_{2}-2x_{1}=-2x_{1}-0.5x_{2}$.

pg 359 \#5

Let $x_{1}=u$, $x_{2}=u^{\prime}$

Then

$x_{1}^{\prime}=x_{2}$

$x_{2}^{\prime}=-4x_{1}-0.25x_{2}$

$x_{1}(0)=u(0)=1$

$x_{2}(0)=u^{\prime}(0)=-2$

pg 360 \#8

Solving the first equation for $2x_{2}$ we get

$2x_{2}=3x_{1}-x_{1}^{\prime}$

I try to avoid fractions in my solution.

Then $2x_{2}^{\prime}=3x_{1}^{\prime}-x_{1}^{\prime\prime}$

Then $3x_{1}^{\prime}-x_{1}^{\prime\prime}=4x_{1}-2(2x_{2})=4x_{1}-2(3x_{1}-x_{1}^{\prime})=-2x_{1}+2x_{1}^{\prime}$

Then $0=x_{1}^{\prime\prime}-x_{1}^{\prime}-2x_{1}$

Thus the characteristic factors as $(r-2)(r+1)$

I leave the rest for you.

pg 371 \#2

Answer is in the back of the book.

pg 373 \#22

$x^{\prime}=\left(\begin{array}{c}
4\\
2\end{array}\right)2e^{2t}$

$\left(\begin{array}{cc}
3 & -2\\
2 & -2\end{array}\right)\left(\begin{array}{c}
4\\
2\end{array}\right)e^{2t}=\left(\begin{array}{c}
3\cdot4+(-2)\cdot2\\
2\cdot4+(-2)\cdot2\end{array}\right)e^{2t}=\left(\begin{array}{c}
8\\
4\end{array}\right)e^{2t}=\left(\begin{array}{c}
4\\
2\end{array}\right)2e^{2t}$

Great!

pg 384 \#16

$\left(\begin{array}{cc}
5 & -1\\
3 & 1\end{array}\right)-\lambda\left(\begin{array}{cc}
1 & 0\\
0 & 1\end{array}\right)=\left(\begin{array}{cc}
5-\lambda & -1\\
3 & 1-\lambda\end{array}\right)$

$\left|\begin{array}{cc}
5-\lambda & -1\\
3 & 1-\lambda\end{array}\right|=(5-\lambda)(1-\lambda)-(-1)\cdot3=\lambda^{2}-6\lambda+8$

$0=(\lambda-4)(\lambda-2)$

A) $\lambda=4$

$\left(\begin{array}{cc}
1 & -1\\
3 & -3\end{array}\right)\to\left(\begin{array}{cc}
1 & -1\\
0 & 0\end{array}\right)\to x_{1}-x_{2}=0$

The row reduced matrix is rank one, so we have one free variable.
Let $x_{2}=a$. Then $x_{1}=a$. Then we have the eigenspace $\left(\begin{array}{c}
a\\
a\end{array}\right)$. Thus one eigenvector for $\lambda=4$ is $\left(\begin{array}{c}
1\\
1\end{array}\right)$.

B) $\lambda=2$

$\left(\begin{array}{cc}
3 & -1\\
3 & -1\end{array}\right)\to\left(\begin{array}{cc}
3 & -1\\
0 & 0\end{array}\right)\to3x_{1}-x_{2}=0$

As with A) above, we have one free variable. Let $x_{1}=a$. Then
$x_{2}=3a$. Then we have the eigenspace $\left(\begin{array}{c}
a\\
3a\end{array}\right)$. So one eigenvector for $\lambda=2$ is $\left(\begin{array}{c}
1\\
3\end{array}\right)$.

Note with both A and B you can choose the other variable to be the
free variable and you would get the same eigenspace, and same eigenvector
depending on your value for the free variable. Explicitly,

let $x_{2}=b$. Then $x_{1}=\frac{1}{3}b$. Then we have the eigenspace
$\left(\begin{array}{c}
\frac{1}{3}b\\
b\end{array}\right)$. I leave it to you to understand that $\left\{ \left(\begin{array}{c}
\frac{1}{3}b\\
b\end{array}\right)\mid b\in\mathbb{R}\right\} =\left\{ \left(\begin{array}{c}
a\\
3a\end{array}\right)\mid a\in\mathbb{R}\right\} $.

pg 384 \#21

$\det\left(\begin{array}{cc}
-3-\lambda & 3/4\\
-5 & 1-\lambda\end{array}\right)=\lambda^{2}+2\lambda-3+\frac{15}{4}=\lambda^{2}+2\lambda+\frac{3}{4}=0$

This factors into $\left(\lambda+\frac{3}{2}\right)\left(\lambda+\frac{1}{2}\right)$.
You can do this in your head, or use the quadractic formula, or instead
you can multiply by $4$ and work with $4\lambda^{2}+8\lambda+3=(2\lambda+3)(2\lambda+1)$.
In any case the end result is the same. $\lambda=-\frac{3}{2}$ or
$-\frac{1}{2}$.

pg 398 \#1a

Find the eigenvalues to be $\lambda=-1$ and $\lambda=2$.

Find corresponding eigenvectors to be $\left(\begin{array}{c}
1\\
2\end{array}\right)$ and $\left(\begin{array}{c}
2\\
1\end{array}\right)$.

Thus we have a general solution: $c_{1}\left(\begin{array}{c}
1\\
2\end{array}\right)e^{-1\cdot t}+c_{2}\left(\begin{array}{c}
2\\
1\end{array}\right)e^{2t}$

As $t\to\infty$ $e^{-t}\to0$ and so all solutions approach the line
$l(a)=\left(\begin{array}{c}
2\\
1\end{array}\right)a$.

pg 399 \#15

Find the general solution to be $c_{1}\left(\begin{array}{c}
1\\
3\end{array}\right)e^{2\cdot t}+c_{2}\left(\begin{array}{c}
1\\
1\end{array}\right)e^{4\cdot t}$

Let me know if you have difficulty finding the general solution.

Then set $t=0$ and solve for $c_{1}$ and $c_{2}$.

pg 399 \#24

In section 6 I was slightly stuck and I figured out what I did wrong.
Now that I think about it, I might have made a mistake in section
3. In any case, I should have written down the general solution: $c_{1}\left(\begin{array}{c}
-1\\
2\end{array}\right)e^{-t}+c_{2}\left(\begin{array}{c}
1\\
2\end{array}\right)e^{-2t}$ for part a). Then explain that for some $c_{1},c_{2}$ we get a solution
passing through $(2,3)$. If we want, we can assume this happens at
$t=0$ and solve for $c_{1}$and $c_{2}$, but the picture will be
the same as I did it in class.

Wednesday, December 8, 2010

(Most) Final Exam Solutions

\#2b)

Most people did chain rule:

$f^{\prime}(x)=\frac{1}{(x^{2}+1)\sin x}\left(2x\cdot\sin x+(x^{2}+1)\cos x\right)$

Most errors resulted in not having parentheses, not knowing how to
do chain rule, or perhaps as simple as not knowing the derivative
of $\sin x$ is $\cos x$.

A simpler way to do the problem is by writing

$f(x)=\ln((x^{2}+1)\sin x)=\ln(x^{2}+1)+\ln(\sin x)$

So that

$f^{\prime}(x)=\frac{2x}{x^{2}+1}+\frac{1}{\sin x}\cos x=\frac{2x}{x^{2}+1}+\cot x$.

Note that doing it this way part of the problem comes for free provided
you did \#2a correctly.

Tuesday, November 9, 2010

Section 4.4 Exercise 10

$\begin{align*}\lim_{x\to 0}\frac{\sin 4x}{\tan 5x} & =\lim_{x\to 0}\frac{\sin 4x\cdot \cos 5x}{\sin 5x}\\
& =\lim_{x\to 0}\frac{4}{5}\frac{\sin 4x}{4}\frac{5}{\sin 5x}\cos 5x\\
& =\frac{4}{5}\cdot \lim_{x\to 0}\left(\frac{\sin 4x}{4}\right)\cdot \lim_{x\to 0}\left(\frac{5}{\sin 5x}\right)\cdot \lim_{x\to 0}\left(\cos 5x\right) \\
& =\frac{4}{5}\cdot 1 \cdot 1 \cdot 1=\frac{4}{5}
\end{align*}$

Alternative solution using L'Hospital's rule:
$\begin{align*}\lim_{x\to 0}\frac{\sin 4x}{\tan 5x} &=\lim_{x\to 0} \frac{4\cos 4x}{5\sec ^2 5x}\\
& =\frac {4}{5}\lim_{x\to 0} \left( \cos 4x \cdot \cos ^2 5x \right)\\
& =\frac {4}{5}\lim_{x\to 0} \left( \cos 4x \right) \cdot \lim_{x\to 0} \left( \cos ^2 5x \right)\\
& =\frac {4}{5}\cdot 1 \cdot 1=\frac{4}{5}\end{align*}$