Calculating a function value with Taylor series [on hold]












0














Given a function $f(x)$, how do I calculate it's value with given error range?



For example, how do I calculate $g(-0.1)$ with an error $< 0.001$ when:



$$g(x)=sin(x)+cos(x)$$










share|cite|improve this question















put on hold as off-topic by RRL, Saad, mrtaurho, darij grinberg, choco_addicted Jan 5 at 15:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – RRL, Saad, mrtaurho, choco_addicted

If this question can be reworded to fit the rules in the help center, please edit the question.













  • So you want to know until what order you need to take the Tayor series?
    – WarreG
    Jan 4 at 14:07
















0














Given a function $f(x)$, how do I calculate it's value with given error range?



For example, how do I calculate $g(-0.1)$ with an error $< 0.001$ when:



$$g(x)=sin(x)+cos(x)$$










share|cite|improve this question















put on hold as off-topic by RRL, Saad, mrtaurho, darij grinberg, choco_addicted Jan 5 at 15:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – RRL, Saad, mrtaurho, choco_addicted

If this question can be reworded to fit the rules in the help center, please edit the question.













  • So you want to know until what order you need to take the Tayor series?
    – WarreG
    Jan 4 at 14:07














0












0








0







Given a function $f(x)$, how do I calculate it's value with given error range?



For example, how do I calculate $g(-0.1)$ with an error $< 0.001$ when:



$$g(x)=sin(x)+cos(x)$$










share|cite|improve this question















Given a function $f(x)$, how do I calculate it's value with given error range?



For example, how do I calculate $g(-0.1)$ with an error $< 0.001$ when:



$$g(x)=sin(x)+cos(x)$$







calculus taylor-expansion






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 4 at 16:43









PM.

3,3982825




3,3982825










asked Jan 4 at 10:29









IgorIgor

315




315




put on hold as off-topic by RRL, Saad, mrtaurho, darij grinberg, choco_addicted Jan 5 at 15:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – RRL, Saad, mrtaurho, choco_addicted

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by RRL, Saad, mrtaurho, darij grinberg, choco_addicted Jan 5 at 15:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – RRL, Saad, mrtaurho, choco_addicted

If this question can be reworded to fit the rules in the help center, please edit the question.












  • So you want to know until what order you need to take the Tayor series?
    – WarreG
    Jan 4 at 14:07


















  • So you want to know until what order you need to take the Tayor series?
    – WarreG
    Jan 4 at 14:07
















So you want to know until what order you need to take the Tayor series?
– WarreG
Jan 4 at 14:07




So you want to know until what order you need to take the Tayor series?
– WarreG
Jan 4 at 14:07










2 Answers
2






active

oldest

votes


















4














With
$$
f(x)=f(0)+frac{f^{(1)}(0)}{1!}x+cdots+frac{f^{(n)}(0)}{n!}x^n+R_n(x)
$$



Use the Lagrange form for the remainder
$$
R_n(x)=frac{f^{(n+1)}(c)}{(n+1)!}x^{(n+1)}
$$

where $c$ is between $x$ and $0$.



The derivatives of $g(x)$ are always $pmsin(x)pm cos(x)$ and so
$$
| f^{(n+1)}(c) | le 2
$$

for any $c$.



Then considering the magnitude of the error, find n such that
$$
2 frac{(0.1)^{(n+1)}}{(n+1)!} lt 0.001
$$






share|cite|improve this answer































    0














    The Taylor series of $g(x) = sin(x) + cos(x)$ is
    $$
    1+x-frac{x^2}{2!}-frac{x^3}{3!}+frac{x^4}{4!}+frac{x^5}{5!}- ...
    $$

    You want to evaluate the function $g(-0.1)$ such that it's error is smaller than $0.001$.
    From the Taylor series you can see that the third term $frac{x^3}{3!}$ will be of that order, because $frac{-0.1^3}{6} sim 0.001$. The next term in the series will always be an order smaller so the error will be of the order of $0.0001$ or $mathcal{O}(x^4).$



    What you are left with is
    $$
    g(x) approx 1+x-frac{x^2}{2!}-frac{x^3}{3!}.
    $$

    Now you just fill in $-0.1$ to retrieve the value of the function in that point.






    share|cite|improve this answer

















    • 2




      Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
      – zipirovich
      Jan 4 at 14:57












    • I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
      – WarreG
      Jan 4 at 15:22










    • Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
      – zipirovich
      Jan 4 at 15:24












    • You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
      – WarreG
      Jan 4 at 15:35


















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    With
    $$
    f(x)=f(0)+frac{f^{(1)}(0)}{1!}x+cdots+frac{f^{(n)}(0)}{n!}x^n+R_n(x)
    $$



    Use the Lagrange form for the remainder
    $$
    R_n(x)=frac{f^{(n+1)}(c)}{(n+1)!}x^{(n+1)}
    $$

    where $c$ is between $x$ and $0$.



    The derivatives of $g(x)$ are always $pmsin(x)pm cos(x)$ and so
    $$
    | f^{(n+1)}(c) | le 2
    $$

    for any $c$.



    Then considering the magnitude of the error, find n such that
    $$
    2 frac{(0.1)^{(n+1)}}{(n+1)!} lt 0.001
    $$






    share|cite|improve this answer




























      4














      With
      $$
      f(x)=f(0)+frac{f^{(1)}(0)}{1!}x+cdots+frac{f^{(n)}(0)}{n!}x^n+R_n(x)
      $$



      Use the Lagrange form for the remainder
      $$
      R_n(x)=frac{f^{(n+1)}(c)}{(n+1)!}x^{(n+1)}
      $$

      where $c$ is between $x$ and $0$.



      The derivatives of $g(x)$ are always $pmsin(x)pm cos(x)$ and so
      $$
      | f^{(n+1)}(c) | le 2
      $$

      for any $c$.



      Then considering the magnitude of the error, find n such that
      $$
      2 frac{(0.1)^{(n+1)}}{(n+1)!} lt 0.001
      $$






      share|cite|improve this answer


























        4












        4








        4






        With
        $$
        f(x)=f(0)+frac{f^{(1)}(0)}{1!}x+cdots+frac{f^{(n)}(0)}{n!}x^n+R_n(x)
        $$



        Use the Lagrange form for the remainder
        $$
        R_n(x)=frac{f^{(n+1)}(c)}{(n+1)!}x^{(n+1)}
        $$

        where $c$ is between $x$ and $0$.



        The derivatives of $g(x)$ are always $pmsin(x)pm cos(x)$ and so
        $$
        | f^{(n+1)}(c) | le 2
        $$

        for any $c$.



        Then considering the magnitude of the error, find n such that
        $$
        2 frac{(0.1)^{(n+1)}}{(n+1)!} lt 0.001
        $$






        share|cite|improve this answer














        With
        $$
        f(x)=f(0)+frac{f^{(1)}(0)}{1!}x+cdots+frac{f^{(n)}(0)}{n!}x^n+R_n(x)
        $$



        Use the Lagrange form for the remainder
        $$
        R_n(x)=frac{f^{(n+1)}(c)}{(n+1)!}x^{(n+1)}
        $$

        where $c$ is between $x$ and $0$.



        The derivatives of $g(x)$ are always $pmsin(x)pm cos(x)$ and so
        $$
        | f^{(n+1)}(c) | le 2
        $$

        for any $c$.



        Then considering the magnitude of the error, find n such that
        $$
        2 frac{(0.1)^{(n+1)}}{(n+1)!} lt 0.001
        $$







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Jan 4 at 17:03

























        answered Jan 4 at 16:38









        PM.PM.

        3,3982825




        3,3982825























            0














            The Taylor series of $g(x) = sin(x) + cos(x)$ is
            $$
            1+x-frac{x^2}{2!}-frac{x^3}{3!}+frac{x^4}{4!}+frac{x^5}{5!}- ...
            $$

            You want to evaluate the function $g(-0.1)$ such that it's error is smaller than $0.001$.
            From the Taylor series you can see that the third term $frac{x^3}{3!}$ will be of that order, because $frac{-0.1^3}{6} sim 0.001$. The next term in the series will always be an order smaller so the error will be of the order of $0.0001$ or $mathcal{O}(x^4).$



            What you are left with is
            $$
            g(x) approx 1+x-frac{x^2}{2!}-frac{x^3}{3!}.
            $$

            Now you just fill in $-0.1$ to retrieve the value of the function in that point.






            share|cite|improve this answer

















            • 2




              Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
              – zipirovich
              Jan 4 at 14:57












            • I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
              – WarreG
              Jan 4 at 15:22










            • Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
              – zipirovich
              Jan 4 at 15:24












            • You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
              – WarreG
              Jan 4 at 15:35
















            0














            The Taylor series of $g(x) = sin(x) + cos(x)$ is
            $$
            1+x-frac{x^2}{2!}-frac{x^3}{3!}+frac{x^4}{4!}+frac{x^5}{5!}- ...
            $$

            You want to evaluate the function $g(-0.1)$ such that it's error is smaller than $0.001$.
            From the Taylor series you can see that the third term $frac{x^3}{3!}$ will be of that order, because $frac{-0.1^3}{6} sim 0.001$. The next term in the series will always be an order smaller so the error will be of the order of $0.0001$ or $mathcal{O}(x^4).$



            What you are left with is
            $$
            g(x) approx 1+x-frac{x^2}{2!}-frac{x^3}{3!}.
            $$

            Now you just fill in $-0.1$ to retrieve the value of the function in that point.






            share|cite|improve this answer

















            • 2




              Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
              – zipirovich
              Jan 4 at 14:57












            • I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
              – WarreG
              Jan 4 at 15:22










            • Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
              – zipirovich
              Jan 4 at 15:24












            • You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
              – WarreG
              Jan 4 at 15:35














            0












            0








            0






            The Taylor series of $g(x) = sin(x) + cos(x)$ is
            $$
            1+x-frac{x^2}{2!}-frac{x^3}{3!}+frac{x^4}{4!}+frac{x^5}{5!}- ...
            $$

            You want to evaluate the function $g(-0.1)$ such that it's error is smaller than $0.001$.
            From the Taylor series you can see that the third term $frac{x^3}{3!}$ will be of that order, because $frac{-0.1^3}{6} sim 0.001$. The next term in the series will always be an order smaller so the error will be of the order of $0.0001$ or $mathcal{O}(x^4).$



            What you are left with is
            $$
            g(x) approx 1+x-frac{x^2}{2!}-frac{x^3}{3!}.
            $$

            Now you just fill in $-0.1$ to retrieve the value of the function in that point.






            share|cite|improve this answer












            The Taylor series of $g(x) = sin(x) + cos(x)$ is
            $$
            1+x-frac{x^2}{2!}-frac{x^3}{3!}+frac{x^4}{4!}+frac{x^5}{5!}- ...
            $$

            You want to evaluate the function $g(-0.1)$ such that it's error is smaller than $0.001$.
            From the Taylor series you can see that the third term $frac{x^3}{3!}$ will be of that order, because $frac{-0.1^3}{6} sim 0.001$. The next term in the series will always be an order smaller so the error will be of the order of $0.0001$ or $mathcal{O}(x^4).$



            What you are left with is
            $$
            g(x) approx 1+x-frac{x^2}{2!}-frac{x^3}{3!}.
            $$

            Now you just fill in $-0.1$ to retrieve the value of the function in that point.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Jan 4 at 14:31









            WarreGWarreG

            20819




            20819








            • 2




              Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
              – zipirovich
              Jan 4 at 14:57












            • I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
              – WarreG
              Jan 4 at 15:22










            • Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
              – zipirovich
              Jan 4 at 15:24












            • You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
              – WarreG
              Jan 4 at 15:35














            • 2




              Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
              – zipirovich
              Jan 4 at 14:57












            • I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
              – WarreG
              Jan 4 at 15:22










            • Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
              – zipirovich
              Jan 4 at 15:24












            • You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
              – WarreG
              Jan 4 at 15:35








            2




            2




            Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
            – zipirovich
            Jan 4 at 14:57






            Sorry, but your answer is at least misleading. "The next term" is NOT the same as "the remainder (the sum of all remaining terms)". That's true for series satisfying the Alternating Series Test, and often true for rapidly convergent series, but it's not true in general. So your statement that The next term in the series will always be an order smaller so the error will be... is false.
            – zipirovich
            Jan 4 at 14:57














            I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
            – WarreG
            Jan 4 at 15:22




            I'm saying for this example the next term will be an order smaller. I'm not stating anything general here.
            – WarreG
            Jan 4 at 15:22












            Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
            – zipirovich
            Jan 4 at 15:24






            Yes, the next term will be smaller. But technically speaking, in general that's irrelevant to the question: the error is given by the remainder, not by the next term. If you claim that in this series the error $=$ the remainder can be bounded by the next term, you have to justify this claim. Otherwise, it's wrong.
            – zipirovich
            Jan 4 at 15:24














            You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
            – WarreG
            Jan 4 at 15:35




            You are right. But in this case, because $-1 < x <1$ the value will converge very rapidly to the exact value. Because each following term is guaranteed to be smaller you can approximately guess what order you have to use for the Taylor series, where the question actually is about. I leave it to you then to write an answer with the total remainder.
            – WarreG
            Jan 4 at 15:35



            Popular posts from this blog

            1300-talet

            1300-talet

            Display a custom attribute below product name in the front-end Magento 1.9.3.8