6
$\begingroup$

I need to represent $\cos(x^{1/2})$ by Maclaurin series.

I'm not sure that what I have done is correct. We know Maclaurin series for $\cos(x) = 1- {x^2 \over 2!} +{x^4\over 4!}+\cdots$ So I substitue $x^{1/2}$, and I got $\cos(x^{1/2})= 1 - {x\over 2!} + {x^2\over4!}+\cdots$

But when I check it, with $x=16$, I don't get the correct answer. Where is the problem? Thanks.

  • 0
    Doh! Ignore my last comment. The function can be made to behave itself nicely at 0. $\sqrt{x}$ would not work, but $\text{cos}(\sqrt{x})$ does work.2011-12-19

3 Answers 3

7

What you did is perfectly valid. But note the equality is obtained using the infinite series. $ \cos(x^{1/2})= 1 - {x\over 2!} + {x^2\over4!}+\cdots $

If you just take a few terms of the series, you get an approximation: $ \cos(x^{1/2})\approx 1 - {x\over 2!} + {x^2\over4!}. $

And the larger $x$ is, for a fixed partial sum, the worse the approximation becomes.

Using the first three terms, with $x=16$, you have: $ \cos(16^{1/2})-( 1 - {16\over 2!} + {16^2\over4!})\approx -4.32. $ But if you go out to the $8$th term, the error is small: $ \cos(16^{1/2})-( 1 - {16\over 2!} + {16^2\over4!} +\cdots- {16^7\over 14!})\approx.000195. $

Using even more terms will give you even smaller errors.

  • 0
    @Aaron McDaid Formally making the substitution produces a valid result. I'm not saying that $\cos\sqrt x$ has a Taylor series at $a=0$; just that the identity holds for $x\ge 0$ (since it holds for any argument of the $\cos$).2011-12-19
1

This is correct, how did you check it? I obtain :

  • $\cos(4) =-0.6536$
  • $1 - 16/2 + 16^2/4! = 3,67$
  • $1 - 16/2 + 16^2/4! - 16^3/6! = -2.022$
  • $1 - 16/2 + 16^2/4! - 16^3/6! + 16^4/8! = - 0.39$
  • $\vdots$
  • $1 - 16/2 + 16^2/4! + \cdots - 16^7/14! = - 0.6538$

For $x$ as big as 16, the convergence is not as fast as you may think. It is much faster with small values of $x$.

  • 2
    @AaronMcDaid: The power series in OP's answer converges for all $x$ (even complex). Thus the sum of the series defines a function $f(x)$ with the properties: 1) it is infinitely differentiable everywhere, 2) for all $x\ge0$ we have $f(x)=\cos(\sqrt{x})$. What more can you ask?2011-12-19
1

(Update: It can be answered after all. Please ignore this answer. For negative x, the identity $\text{cos}\sqrt{x} = \text{cosh}\sqrt{-x}$ behaves nicely and it's possible to fill in the singularity.)

This question cannot be answered. The function $\text{cos}(x^\frac12)$ is not continuous at 0 and hence it is not meaningful to think about a Maclaurin series.

You would be attempting to take a square root of a negative number. And complex analysis won't help here either, as a Maclaurin it needs to be infinitely differentiable at 0, and it is not.

You could take the Taylor series at any positive value.

  • 0
    OK, That all makes sense now. +1 to David2011-12-19