Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Give exact ways of avoiding loss-of-significance errors in the following computations:

a. $log(x+1)-log$, with large $x$

b. $\frac{1-cosx}{x^2}$, with $x\approx 0$

c.$(1+x)^{1/3}-1$, with $x\approx 0$

Am I doing this correctly?

a. I got $$log(x+1)-log(x)= log(\frac{x+1}{x})= log(1+\frac{1}{x}) \approx \frac{1}{x}-\frac{1}{2x^2}+\frac{1}{3x^3} ...$$

c. I got $$\frac{x}{(1+x)^{2/3}+(1+x)^{1/3}+1}$$

b. I am stuck

share|improve this question
    
The question does not ask for the limits. –  André Nicolas Feb 4 '13 at 9:04
    
You aren't being asked to find limits, but to carry out computations. Sure, $\log1000000-\log999999$ is near zero, but how do you get a good handle on it? –  Gerry Myerson Feb 4 '13 at 9:05
3  
If for example you have a calculator that computes correctly to $8$ significant figures, but no more, and you calculate $\sqrt[3]{1+x}$, where $x=10^{-7}$, the answer is very close to $1$, so when you subtract $1$ you don't get $8$ figure accuracy. How can you rearrange the calculation to get close to $8$ figure accuracy? –  André Nicolas Feb 4 '13 at 9:14
    
@AndréNicolas I knew what I was doing was wrong. I should have not listened to my roommate. Is my revised answer correct? –  Lays Feb 4 '13 at 9:23
1  
Those look like good ways to rearrange the terms for more accurate computations. In c) you've left out some parentheses. In b) you could try to make use of $\sin^2x+\cos^2x=1$. –  Gerry Myerson Feb 4 '13 at 9:56
show 4 more comments

2 Answers

up vote 1 down vote accepted

a)

$$\log{(x+1)} = \log{x} + \log{\left (1 + \frac{1}{x} \right )}$$

Use the Taylor series approximation for $\log{y}$ for small values of $y$:

$$\log{(x+1)} - \log{x} = \frac{1}{x} - \frac{1}{2 x^2} + \frac{1}{3 x^3} + \dots$$

b) Again, use the Taylor series for $\cos{x}$ about $x=0$:

$$\frac{1-\cos{x}}{x^2} = \frac{1}{2} - \frac{x^2}{24} + \dots$$

c) Taylor expansion or a binomial expansion:

$$\begin{align}(1+x)^{1/3}&= 1 + \frac{1}{1!} \frac{1}{3} x + \frac{1}{2!} \frac{1}{3} \left (-\frac{2}{3} \right ) x^2 + \frac{1}{3!} \frac{1}{3} \left (-\frac{2}{3} \right ) \left (-\frac{5}{3} \right ) x^3 + \ldots \\ \end{align} $$

so that

$$(1+x)^{1/3} - 1 = \frac{1}{3} x - \frac{1}{9} x^2 + \frac{5}{81} x^3 - \ldots$$

share|improve this answer
add comment

As for part (c), You can use the Taylor series to get: $$(1+x)^{1/3}\sim 1+\frac{x}{3}-\frac{x^2}{9}+O(x^3)$$

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.