How to choose the correct function to use for a Taylor expansion?

AI Thread Summary
Choosing the correct function for a Taylor expansion depends on the desired precision and the context of the problem. In this discussion, two functions, f1(s) and f2(s), are analyzed, both yielding the same results for the electric field when evaluated under different definitions of the variable s. The Taylor expansions differ initially, but when substituting the respective definitions of s, they converge to the same expressions. The conclusion emphasizes that the choice of approximation does not affect the final outcome for the electric field when z is much greater than R. Understanding the relationship between the functions and their expansions is crucial for accurate analysis in physics.
zenterix
Messages
774
Reaction score
84
Homework Statement
I have a question regarding a mathematical tool used a lot in physics apparently: Taylor expansions.
Relevant Equations
Here is the context.

I calculated the electric field at a particular point in 3D space.

$$E_p=\begin{cases}
\frac{2k_eQ}{R^2}(1-\frac{z}{(z^2+R^2)^{1/2}}) & \text{for } z \geq 0\\
\frac{2k_eQ}{R^2}(-1-\frac{z}{(z^2+R^2)^{1/2}}) & \text{for } z < 0\\
\end{cases}$$

And I am interested in knowing what happens when ##z>>R##

First, to isolate just the mathematical operation of Taylor expansion, let's consider

$$\frac{z}{(z^2+R^2)^{1/2}}$$
$$=\frac{1}{(1+\frac{R^2}{z^2})^{1/2}}$$

When ##z>>R## we also have ##\frac{R}{z}## and ##\frac{R^2}{z^2}## both approach zero.
Consider two different Taylor expansions.

First, let ##f_1(s)=(1+s)^{1/2}##

$$f_1'(s)=-\frac{1}{2(1+s^{3/2})}$$

Near ##s=0##, we have the first order Taylor expansion
$$f_1(s) \approx 1 - \frac{s}{2}$$

Now consider a different choice for ##f(s)##

$$f_2(s)=(1+s^2)^{1/2}$$
$$f_2'(s)=-\frac{s}{(1+s)^{3/2}}$$
$$f_2''(s)=-\frac{1}{(1+s)^{1/2}}+\frac{3s^2}{(1+s^2)^{5/2}}$$

Near ##s=0##, we have the first order Taylor expansion
$$f_2(s)\approx 1$$

and the second order Taylor expansion
$$f_2(s) \approx 1 - \frac{s^2}{2}$$

My question is simply: how do we choose which approximation to use?

Considering the original context of what happens to the electric field if ##z>>R##, it appears that the choice of Taylor expansion doesn't affect the result. I guess I am trying to wrap my head around the intuition of why this is.

If I use ##f_1##, then

$$E_p=\begin{cases}
\frac{2k_eQ}{R^2}(1-1+\frac{R^2}{2z^2}) & \text{for } z \geq 0\\
\frac{2k_eQ}{R^2}(-1-1+\frac{R^2}{2z^2}) & \text{for } z < 0\\
\end{cases}$$

$$E_p=\begin{cases}
\frac{k_eQ}{z^2} & \text{for } z \geq 0\\
\frac{k_eQ}{z^2}-\frac{4k_eQ}{R^2} & \text{for } z < 0\\
\end{cases}$$

If I use ##f_2##, then

$$E_p=\begin{cases}
\frac{2K_eQ}{R^2}(1-1+\frac{R^4}{2z^4}) & \text{for } z \geq 0\\
\frac{2K_eQ}{R^2}(-1-1+\frac{R^4}{2z^4}) & \text{for } z < 0\\
\end{cases}$$

$$E_p=\begin{cases}
\frac{k_eQ}{z^2} & \text{for } z \geq 0\\
\frac{k_eQ}{z^2}-\frac{4k_eQ}{R^2} & \text{for } z < 0\\
\end{cases}$$

ie, same result in both cases.Here are some plots

1636558155318.png
1636558507874.png

1636558245236.png
1636558271728.png

1636558292263.png
 
Last edited:
Physics news on Phys.org
zenterix said:
My question is simply: how do we choose which approximation to use?
It depends how precise an answer you want.
 
PeroK said:
It depends how precise an answer you want.
Inoticed that both calculations give the same result ultimately. The result differs in the variable ##s## but it is the same in ##R## and ##z##.
 
zenterix said:
Inoticed that both calculations give the same result ultimately. The result differs in the variable ##s## but it is the same in ##R## and ##z##.
I'm not sure I know what that means.
 
What I mean is that if you just consider the functions ##f_1## and ##f_2## as I defined them, they are in fact two different functions of ##s##. The Taylor expansions will be different for each function.

However, we actually defined ##s## differently in each case. For ##f_1## we had ##s=\frac{R}{z}## and for ##f_2## we had ##s=\frac{R^2}{z^2}##. When we substitute these ##s## expressions into the respective Taylor expansions, the Taylor expansions are the same.
 
zenterix said:
What I mean is that if you just consider the functions ##f_1## and ##f_2## as I defined them, they are in fact two different functions of ##s##. The Taylor expansions will be different for each function.

However, we actually defined ##s## differently in each case. For ##f_1## we had ##s=\frac{R}{z}## and for ##f_2## we had ##s=\frac{R^2}{z^2}##. When we substitute these ##s## expressions into the respective Taylor expansions, the Taylor expansions are the same.
That makes sense. They must be the same.
 
I think I've gotten some practice some with Taylor expansions :)
 
  • Like
Likes PeroK
zenterix said:
Homework Statement:: I have a question regarding a mathematical tool used a lot in physics apparently: Taylor expansions.
Relevant Equations:: Here is the context.

I calculated the electric field at a particular point in 3D space.

$$E_p=\begin{cases}
\frac{2k_eQ}{R^2}(1-\frac{z}{(z^2+R^2)^{1/2}}) & \text{for } z \geq 0\\
\frac{2k_eQ}{R^2}(-1-\frac{z}{(z^2+R^2)^{1/2}}) & \text{for } z < 0\\
\end{cases}$$

And I am interested in knowing what happens when ##z>>R##
I would assume that you are interested in knowing what happens to the electric field, not part of the electric field, when ##z>>R##. In that case, your function should be the entire expression for the electric field, not just a piece of it. That is always safe. You have $$E_p=\begin{cases}
\frac{2k_eQ}{R^2}(1-\frac{z}{(z^2+R^2)^{1/2}}) & \text{for } z \geq 0\\
\frac{2k_eQ}{R^2}(-1-\frac{z}{(z^2+R^2)^{1/2}}) & \text{for } z < 0\\
\end{cases}.$$ You can expand the top function in Taylor series and then note that if you subtract ##2\times \dfrac{2k_eQ}{R^2}## from the top function, you get the bottom function. So if you expand the top function to any order, you immediately have the bottom function to the same order. That is also safe.
 
  • Like
Likes zenterix
Back
Top