# 4th order Taylor approximation

baseballfan_ny
Homework Statement:
Get a 4th order taylor approximation for $$f(p) = (1 + \frac {p^2} {m^2c^2})^{\frac 1 2}$$
Relevant Equations:
$$\sum_{n=0}^\infty \frac {f^{(n)}(a) (x-a)^n} {n!}$$ around a = 0
So I just followed Taylor's formula and got the four derivatives at p = 0

##f^{(0)}(p) = (1 + \frac {p^2} {m^2c^2})^{\frac 1 2} ##
##f^{(0)}(0) = 1 ##

## f^{(1)}(p) = \frac {p} {m^2c^2}(1 + \frac {p^2} {m^2c^2})^{\frac {-1} 2} ##
## f^{(1)}(0) = 0 ##

## f^{(2)}(p) = \frac {1} {m^2c^2}(1 + \frac {p^2} {m^2c^2})^{\frac {-1} 2} - \frac {p^2} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2} ##
## f^{(2)}(0) = \frac {1} {m^2c^2} ##

## f^{(3)}(p) = \frac {p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2} - \frac {3p^3} {m^6c^6}(1 + \frac {p^2} {m^2c^2})^{\frac {-5} 2} ##
## f^{(3)}(0) = 0##

## f^{(4)}(p) = \frac {1} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2} +... ## (terms that are 0 when p = 0)
## f^{(4)}(0) = \frac {1} {m^4c^4} ##

Now that would give me $$f(p) = 1 + \frac {p^2} {2! m^2c^2} + \frac {p^4} {4! m^4c^4}$$
$$f(p) = 1 + \frac {p^2} {2m^2c^2} + \frac {p^4} {24m^4c^4}$$

But that's not right. The answer key has the following answer (and so does Wolfram) $$f(p) = 1 + \frac {p^2} {2m^2c^2} - \frac {p^4} {8m^4c^4}$$

A picture of the answer key soln is below. Ignore the factor of ##Mc^2## outside the approximation.

I noticed that the answer doesn't even get any of the derivatives equal to 0, and I was getting all the odd derivatives equal to 0. That makes me think I'm applying Taylor's formula incorrectly and it's more than just an algebra mistake?

Homework Helper
Can you check your ##f^{(3)}(p)\ ## ?

Another comment: looks as if the expansion can be done with ##p^2## as a variable (as opposed to ##p##)...

##\ ##

baseballfan_ny and FactChecker
Staff Emeritus
Homework Helper
Gold Member
Taylor expand ##\sqrt{1+x}## to second order in ##x##. Set ##x= p^2/(mc)^2##.

baseballfan_ny, Mark44 and FactChecker
Staff Emeritus
Homework Helper
Gold Member
Homework Statement:: Get a 4th order taylor approximation for $$f(p) = (1 + \frac {p^2} {m^2c^2})^{\frac 1 2}$$
Relevant Equations:: $$\sum_{n=0}^\infty \frac {f^{(n)}(a) (x-a)^n} {n!}$$ around a = 0

So I just followed Taylor's formula and got the four derivatives at p = 0
. . .

. . .
Now that would give me $$f(p) = 1 + \frac {p^2} {2! m^2c^2} + \frac {p^4} {4! m^4c^4}$$
$$f(p) = 1 + \frac {p^2} {2m^2c^2} + \frac {p^4} {24m^4c^4}$$

But that's not right. The answer key has the following answer (and so does Wolfram) $$f(p) = 1 + \frac {p^2} {2m^2c^2} - \frac {p^4} {8m^4c^4}$$
. . .
I agree with @BvU .
Looks like you missed or messed up the product rule in differentiating the second term in your expression for ## f^{(2)}(p) ##.
## f^{(2)}(p) = \frac {1} {m^2c^2}(1 + \frac {p^2} {m^2c^2})^{\frac {-1} 2} - \frac {p^2} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2} ##

## f^{(3)}(p) = \frac {p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2} - \frac {3p^3} {m^6c^6}(1 + \frac {p^2} {m^2c^2})^{\frac {-5} 2} ##
A couple of suggestions have been given to you.

You might also want to consider that your expression for ## f^{(2)}(p) ## can be significantly simplified.

I have that ##\displaystyle f^{(2)}(p) = \frac {1} {m^2c^2}\left(1 + \frac {p^2} {m^2c^2}\right)^{ \frac { {-3} } {2}}##

Last edited:
baseballfan_ny
baseballfan_ny
Can you check your f(3)(p) ?
I definitely messed something up, but I keep getting that that ##f^{(3)}(0) = 0##.

$$f^{(2)}(p) = \frac {1} {m^2c^2}(1 + \frac {p^2} {m^2c^2})^{\frac {-1} 2} - \frac {p^2} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2}$$

$$f^{(3)}(p) = \frac {-1} {2} \frac {1} {m^2c^2}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} \frac {2p} {m^2c^2} - \frac {2p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} - \frac {p^2} {m^4c^4} \frac {-3} {2} (1 + \frac {p^2} {m^2c^2})^{\frac {-5} {2}} \frac {2p} {m^2c^2}$$

$$f^{(3)}(p) = - \frac {p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} - \frac {2p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} + \frac {3p^3} {m^6c^6} (1 + \frac {p^2} {m^2c^2})^{\frac {-5} {2}}$$

$$f^{(3)}(p) = - \frac {3p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} + \frac {3p^3} {m^6c^6} (1 + \frac {p^2} {m^2c^2})^{\frac {-5} {2}}$$

which still vanishes when p = 0.

You might also want to consider that your expression for f(2)(p) can be significantly simplified.

I have that

How did you make that simplification? Are our expressions for ##f^{(2)}(p)## consistent?

Taylor expand ##\sqrt{1+x}## to second order in ##x##. Set ##x= p^2/(mc)^2##.
Oh I suppose that would be easier. I think that's what the answer key did. I'm kind of wondering why are we allowed to substitute in expressions for variables that would carry different inside derivatives when applying the chain rule? Maybe that will clear up when I'm able to fix my algebra but I'm just curious.

Thanks all for the replies btw!

baseballfan_ny
Oh wait a sec, my diff expression of ##f^{(3)}(p)## has consequences on ##f^{(4)}(p)##!

Now I get...
##f^{(4)}(p) = - \frac {3p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} + ... ## (other terms that vanish when p = 0)

which means ##f^{(4)}(0) = \frac {-3} {m^4c^4} ## and that gives me the Taylor approximation with the 4th order coeff being ##\frac {-1} {8}##. Thanks y'all!

I'm still wondering about why the substitution works though... How come the inside derivatives don't impact anything?

BvU
Staff Emeritus
Gold Member
Oh wait a sec, my diff expression of ##f^{(3)}(p)## has consequences on ##f^{(4)}(p)##!

Now I get...
##f^{(4)}(p) = - \frac {3p} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} {2}} + ... ## (other terms that vanish when p = 0)

which means ##f^{(4)}(0) = \frac {-3} {m^4c^4} ## and that gives me the Taylor approximation with the 4th order coeff being ##\frac {-1} {8}##. Thanks y'all!

I'm still wondering about why the substitution works though... How come the inside derivatives don't impact anything?

Just think about the meaning of a Taylor series. If ##f(x)=\sqrt{1+x}\approx 1+\frac{1}{2} x## when ##x=0.00001##, then when ##y=0.001##, ##y^2=x## so we should get that ##f(y^2)\approx 1+\frac{1}{2} y^2##. If there was some better approximation in terms of y, you could just use that to get a better approximation of ##f(x)## in terms of x

baseballfan_ny
Homework Helper
I'm still wondering about why the substitution works though... How come the inside derivatives don't impact anything?
Must have something to do with the fact that a function of ##p^2## is even, so a Taylor expansion can't have any odd powers of ##p## in it . . .

##\ ##

Homework Helper
2022 Award
Taylor expand ##\sqrt{1+x}## to second order in ##x##. Set ##x= p^2/(mc)^2##.

Oh I suppose that would be easier. I think that's what the answer key did. I'm kind of wondering why are we allowed to substitute in expressions for variables that would carry different inside derivatives when applying the chain rule? Maybe that will clear up when I'm able to fix my algebra but I'm just curious.

I think the answer key is using the binomial series for $$(1 + x)^\alpha = 1 + \alpha x + \frac{\alpha(\alpha-1)}{2}x^2 + \dots + \frac{\alpha(\alpha-1) \cdots (\alpha - n + 1)}{n!}x^n + \dots, \qquad |x| < 1,$$ with $x = p^2/(mc)^2$ and $\alpha = \frac12$.

Staff Emeritus
Homework Helper
Gold Member
I definitely messed something up, but I keep getting that that ##f^{(3)}(0) = 0##.

$$f^{(2)}(p) = \frac {1} {m^2c^2}(1 + \frac {p^2} {m^2c^2})^{\frac {-1} 2} - \frac {p^2} {m^4c^4}(1 + \frac {p^2} {m^2c^2})^{\frac {-3} 2}$$

How did you make that simplification? Are our expressions for ##f^{(2)}(p)## consistent?