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

In summary, we can use Taylor expansions to approximate functions and determine the behavior of a function as a variable approaches a certain value. In this particular case, we see that the choice of Taylor expansion does not affect the final result for the electric field, as both approximations ultimately lead to the same result.
  • #1
zenterix
693
83
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
  • #2
zenterix said:
My question is simply: how do we choose which approximation to use?
It depends how precise an answer you want.
 
  • #3
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##.
 
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 
  • #7
I think I've gotten some practice some with Taylor expansions :)
 
  • Like
Likes PeroK
  • #8
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

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

1. How do I know which function to use for a Taylor expansion?

The function used for a Taylor expansion depends on the specific problem or function being approximated. Generally, it is best to choose a function that is infinitely differentiable and has a known value at the point of expansion.

2. Can I use any function for a Taylor expansion?

No, not all functions are suitable for a Taylor expansion. The function must be infinitely differentiable and have a known value at the point of expansion. Otherwise, the approximation may not accurately represent the original function.

3. What is the purpose of a Taylor expansion?

The purpose of a Taylor expansion is to approximate a more complicated function with a simpler one. This allows for easier calculations and analysis of the original function.

4. How do I determine the order of the Taylor expansion?

The order of the Taylor expansion refers to the number of terms used in the approximation. It is typically determined by the desired level of accuracy. The higher the order, the more accurate the approximation will be.

5. Is there a limit to the number of terms in a Taylor expansion?

Technically, there is no limit to the number of terms that can be used in a Taylor expansion. However, as the number of terms increases, the calculations become more complex and may not be practical. It is important to find a balance between accuracy and practicality when choosing the number of terms.

Back
Top