6

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.

Adam Sh
  • 271
  • 2
    The problem is that the derivative of $\sqrt{x}$ is not defined in 0. – Jon Dec 18 '11 at 18:16
  • You probably aren't taking enough terms. "check" $x=16$, with more terms in the expansion. – David Mitra Dec 18 '11 at 18:19
  • I suspect you have rounding problems: what do you get with $x=4$ in the first formula? – Henry Dec 18 '11 at 18:22
  • If "check" means to numerically compare $\cos(x^{1/2})$ with a partial sum of the series for $x=16$, you'll probably want to go up to $x^8$ or so. – Robert Israel Dec 18 '11 at 18:27
  • @Jon's comment is potentially very important. It might mean that the two current answers are incorrect, including the 'accepted' answer. – Aaron McDaid Dec 19 '11 at 14:26
  • 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. – Aaron McDaid Dec 19 '11 at 15:01

3 Answers3

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.

David Mitra
  • 74,748
  • This is not valid. $cos(x^\frac12)$ is not even continuous at 0, and it needs to be infinitely differentiable in order to define a Maclaurin series. (Thanks to @Jon for pointing me 99% of the way to the answer.) – Aaron McDaid Dec 19 '11 at 14:34
  • @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$). – David Mitra Dec 19 '11 at 14:44
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$.

Elvis
  • 957
  • This is not valid. $cos(x^\frac12)$ is not even continuous at 0, and it needs to be infinitely differentiable in order to define a Maclaurin series. (Thanks to @Jon for pointing me 99% of the way to the answer.) – Aaron McDaid Dec 19 '11 at 14:35
  • 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? – Jyrki Lahtonen Dec 19 '11 at 15:00
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.

  • 1
    Hmm, let me think... since $\cos,ix=\cosh,x$, the function still ought to make sense for $x < 0$. The first derivative is $-\frac12\mathrm{sinc}(\sqrt x)$, and a similar hyperbolic representation can be derived for $x < 0$. Hmm... – J. M. ain't a mathematician Dec 19 '11 at 14:41
  • @J.M. , cool observation! (Update, I'm tempted to delete the rest of this comment, I was getting ahead of myself) So it's defined nicely for x<0 , and for x>0, but what happens at x=0? Can the two sides be joined together? (I'm going to quickly do some plots now) – Aaron McDaid Dec 19 '11 at 14:45
  • Sure looks like it to me. You're familiar with $\lim\limits_{x\to 0}\frac{\sin,x}{x}=1$, yes? – J. M. ain't a mathematician Dec 19 '11 at 14:46
  • But when you take the derivatives you get also the contributions coming from sine and cosine functions that are able to compensate the singular behavior of $\sqrt{x}$. So, e.g. $\left.(\cos(\sqrt{x}))'\right|_{x=0}=\frac{1}{2}$. David's answer is correct and OP problem is just a matter of slowness of convergence of the series. The latter is the only effect of the singular behavior of the argument of the cosine. – Jon Dec 19 '11 at 14:47
  • Yep. I'm familiar with that. – Aaron McDaid Dec 19 '11 at 14:47
  • OK, That all makes sense now. +1 to David – Aaron McDaid Dec 19 '11 at 14:57