# How do you find the taylor series series for f(x)=lnx at a=2?

Jul 21, 2015

$\ln \left(2\right) + \frac{1}{2} \left(x - 2\right) - \frac{1}{8} {\left(x - 2\right)}^{2} + \frac{1}{24} {\left(x - 2\right)}^{3} - \frac{1}{64} {\left(x - 2\right)}^{4} + \setminus \cdots$

#### Explanation:

Use the following expression for the Taylor series of an infinitely differentiable function at $x = a$:

f(a)+f'(a)(x-a)+(f''(a))/(2!)(x-a)^2+(f'''(a))/(3!)(x-a)^3+(f''''(a))/(4!)(x-a)^4\cdots

Since $f \left(x\right) = \ln \left(x\right)$, we get $f ' \left(x\right) = \frac{1}{x} = {x}^{- 1}$, $f ' ' \left(x\right) = - {x}^{- 2}$, $f ' ' ' \left(x\right) = 2 {x}^{- 3}$, $f ' ' ' ' \left(x\right) = - 6 {x}^{- 4}$, etc...

Since $a = 2$, we calculate $f \left(2\right) = \ln \left(2\right)$, $f ' \left(2\right) = \frac{1}{2}$, $f ' ' \left(2\right) = - \frac{1}{4}$, $f ' ' ' \left(2\right) = \frac{2}{8} = \frac{1}{4}$, $f ' ' ' ' \left(2\right) = - \frac{6}{16} = - \frac{3}{8}$, etc...

Therefore, we can write the answer as

$\ln \left(2\right) + \frac{1}{2} \left(x - 2\right) - \frac{1}{8} {\left(x - 2\right)}^{2} + \frac{1}{24} {\left(x - 2\right)}^{3} - \frac{1}{64} {\left(x - 2\right)}^{4} + \setminus \cdots$

This series happens to equal $\ln \left(x\right)$ for $0 < x < 4$ (the "radius of convergence" is 2 and it equals the function for these values as well).

Jul 22, 2015

First, we can start with the general definition of the Taylor series expansion, which is:

sum_(n=0)^N f^((n))(a)/(n!)(x-a)^n

where ${f}^{\left(n\right)} \left(a\right)$ is the $n$th derivative of $f \left(x\right)$ evaluated at $x \to a$, $n$ varies, $a$ does not, and n! is $1 \times 2 \times 3 \times \cdots \times \left(n - 1\right) \times n$. Note that $x \to a$ does not apply to ${\left(x - a\right)}^{n}$ (yes, I've seen that happen).

Thus you have to take the derivative up to some $n$th order term. Let's say $n = 4$. Then you have:

${f}^{\left(0\right)} \left(x\right) = f \left(x\right) = \ln x$
$f ' \left(x\right) = \frac{1}{x}$
$f ' ' \left(x\right) = - \frac{1}{x} ^ 2$
$f ' ' ' \left(x\right) = \frac{2}{{x}^{3}}$
$f ' ' ' ' \left(x\right) = - \frac{6}{{x}^{4}}$

Now you have the final result to simplify:

sum_(n=0)^(4) = (f(2))/(0!)(x-2)^0 + (f'(2))/(1!)(x-2)^1 + (f''(2))/(2!)(x-2)^2 + (f'''(2))/(3!)(x-2)^3 + (f''''(2))/(4!)(x-2)^4 + ...

$= \left(\ln 2\right) + \left(\frac{1}{2}\right) \left(x - 2\right) + \frac{- \frac{1}{4}}{2} {\left(x - 2\right)}^{2} + \frac{\frac{2}{8}}{6} {\left(x - 2\right)}^{3} + \frac{- \frac{6}{16}}{24} {\left(x - 2\right)}^{4} + \ldots$

$= \textcolor{b l u e}{\ln 2 + \frac{1}{2} \left(x - 2\right) - \frac{1}{8} {\left(x - 2\right)}^{2} + \frac{1}{24} {\left(x - 2\right)}^{3} - \frac{1}{64} {\left(x - 2\right)}^{4} + \ldots}$

Just remember the following:
- $x \to a$ only for $f \left(a\right)$, not ${\left(x - a\right)}^{n}$
- $n$ varies, but $a$ does not
- It's probably wise to take the $n$th derivatives first so you aren't doing them as you are writing out the next step from the point you write out the general series formula