Approximate $log(7)+cos(1)$ with an error of less than $10^-4$
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Evaluate $log(7)+cos(1)$ with an error of less than $10^-4$
Obviously the aim is to use Taylor's expansion with Lagrange's remainder, but where to center it? I was thinking in $e^2$, which seems to me a bit too large.
real-analysis taylor-expansion approximation
 |Â
show 3 more comments
up vote
1
down vote
favorite
Evaluate $log(7)+cos(1)$ with an error of less than $10^-4$
Obviously the aim is to use Taylor's expansion with Lagrange's remainder, but where to center it? I was thinking in $e^2$, which seems to me a bit too large.
real-analysis taylor-expansion approximation
1
If you are free in the method, I would suggest to solve $e^x=7$ with newton's method rather than use the taylor-expansion of $ln(x)$.
â Peter
Aug 13 at 10:09
@Peter I have never used it in an exercise. Can you show me how to use it? Thank you
â F.inc
Aug 13 at 10:23
2
By writing $$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+2cos^2tfrac12-1 $$ we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$.
â Jack D'Aurizioâ¦
Aug 13 at 10:27
In order to solve $e^x=7$ through Newton's method you still need to compute exponentials, so the problem is pretty much the same.
â Jack D'Aurizioâ¦
Aug 13 at 10:30
1
@Peter: $7=8/ frac87 = 2^3/left(1+frac17right) = left(1-frac12right)^-3left(1+frac17right)^-1$.
â Jack D'Aurizioâ¦
Aug 13 at 10:59
 |Â
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Evaluate $log(7)+cos(1)$ with an error of less than $10^-4$
Obviously the aim is to use Taylor's expansion with Lagrange's remainder, but where to center it? I was thinking in $e^2$, which seems to me a bit too large.
real-analysis taylor-expansion approximation
Evaluate $log(7)+cos(1)$ with an error of less than $10^-4$
Obviously the aim is to use Taylor's expansion with Lagrange's remainder, but where to center it? I was thinking in $e^2$, which seems to me a bit too large.
real-analysis taylor-expansion approximation
asked Aug 13 at 9:58
F.inc
3158
3158
1
If you are free in the method, I would suggest to solve $e^x=7$ with newton's method rather than use the taylor-expansion of $ln(x)$.
â Peter
Aug 13 at 10:09
@Peter I have never used it in an exercise. Can you show me how to use it? Thank you
â F.inc
Aug 13 at 10:23
2
By writing $$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+2cos^2tfrac12-1 $$ we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$.
â Jack D'Aurizioâ¦
Aug 13 at 10:27
In order to solve $e^x=7$ through Newton's method you still need to compute exponentials, so the problem is pretty much the same.
â Jack D'Aurizioâ¦
Aug 13 at 10:30
1
@Peter: $7=8/ frac87 = 2^3/left(1+frac17right) = left(1-frac12right)^-3left(1+frac17right)^-1$.
â Jack D'Aurizioâ¦
Aug 13 at 10:59
 |Â
show 3 more comments
1
If you are free in the method, I would suggest to solve $e^x=7$ with newton's method rather than use the taylor-expansion of $ln(x)$.
â Peter
Aug 13 at 10:09
@Peter I have never used it in an exercise. Can you show me how to use it? Thank you
â F.inc
Aug 13 at 10:23
2
By writing $$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+2cos^2tfrac12-1 $$ we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$.
â Jack D'Aurizioâ¦
Aug 13 at 10:27
In order to solve $e^x=7$ through Newton's method you still need to compute exponentials, so the problem is pretty much the same.
â Jack D'Aurizioâ¦
Aug 13 at 10:30
1
@Peter: $7=8/ frac87 = 2^3/left(1+frac17right) = left(1-frac12right)^-3left(1+frac17right)^-1$.
â Jack D'Aurizioâ¦
Aug 13 at 10:59
1
1
If you are free in the method, I would suggest to solve $e^x=7$ with newton's method rather than use the taylor-expansion of $ln(x)$.
â Peter
Aug 13 at 10:09
If you are free in the method, I would suggest to solve $e^x=7$ with newton's method rather than use the taylor-expansion of $ln(x)$.
â Peter
Aug 13 at 10:09
@Peter I have never used it in an exercise. Can you show me how to use it? Thank you
â F.inc
Aug 13 at 10:23
@Peter I have never used it in an exercise. Can you show me how to use it? Thank you
â F.inc
Aug 13 at 10:23
2
2
By writing $$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+2cos^2tfrac12-1 $$ we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$.
â Jack D'Aurizioâ¦
Aug 13 at 10:27
By writing $$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+2cos^2tfrac12-1 $$ we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$.
â Jack D'Aurizioâ¦
Aug 13 at 10:27
In order to solve $e^x=7$ through Newton's method you still need to compute exponentials, so the problem is pretty much the same.
â Jack D'Aurizioâ¦
Aug 13 at 10:30
In order to solve $e^x=7$ through Newton's method you still need to compute exponentials, so the problem is pretty much the same.
â Jack D'Aurizioâ¦
Aug 13 at 10:30
1
1
@Peter: $7=8/ frac87 = 2^3/left(1+frac17right) = left(1-frac12right)^-3left(1+frac17right)^-1$.
â Jack D'Aurizioâ¦
Aug 13 at 10:59
@Peter: $7=8/ frac87 = 2^3/left(1+frac17right) = left(1-frac12right)^-3left(1+frac17right)^-1$.
â Jack D'Aurizioâ¦
Aug 13 at 10:59
 |Â
show 3 more comments
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
By writing
$$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+cos(1) $$
we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$. We have
$$ cos(1)=sum_n=0^8frac(-1)^n(2n)!+E_1 = frac1130463162168120922789888000+E_1 $$
with $|E_1|leq frac110!$. Similarly
$$ logleft(1+frac17right) = sum_n=1^6frac(-1)^n+1n 7^n+E_2 = frac9425897058940+E_2 $$
with $|E_2|leq frac18cdot 10^5$ and
$$ log(2) = sum_n=1^15frac1n 2^n+E_3 = frac3197207946126080+E_3 $$
with $|E_3|leq frac210^5$. In particular
$$frac1130463162168120922789888000-frac9425897058940+3cdot frac3197207946126080=colorgreen2.4862071ldots $$
is an approximation (a lower bound) of $log(7)+cos(1)$ within the required accuracy.
An improved approach is to write
$$ log(7)+cos(1) = 3log(2)+logleft(1-frac18right)+cos(1), $$
approximate $cos(1)$ and $logleft(1-frac18right)$ via Maclaurin series and approximate $log(2)$ via $0leq int_0^1fracx^n(1-x)^n1+x,dxleqfrac14^n$. With $n=5$ we already get $log(2)approx frac23293360$ with an error $leq 8cdot 10^-6$.
add a comment |Â
up vote
3
down vote
Consider
$$
log(1+x)=x-fracx^22+fracx^33-dotsb=sum_nge1(-1)^n-1fracx^nn
$$
and
$$
log(1-x)=-x-fracx^22-fracx^33-dotsb=-sum_nge1fracx^nn
$$
which holds for $-1<x<1$. Subtracting the second from the first yields
$$
logfrac1+x1-x=2sum_nge0fracx^2n+12n+1
$$
The equation
$$
frac1+x1-x=7
$$
yields $x=3/4$.
Now use the Lagrange remainder formula to ensure that the errors in the Taylor polynomial for $logfrac1+x1-x$ for $x=3/4$ is less than $10^-4/2$ and the in the Taylor polynomial for $cos x$ for $x=1$ is again less than $10^-4/2$.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
By writing
$$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+cos(1) $$
we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$. We have
$$ cos(1)=sum_n=0^8frac(-1)^n(2n)!+E_1 = frac1130463162168120922789888000+E_1 $$
with $|E_1|leq frac110!$. Similarly
$$ logleft(1+frac17right) = sum_n=1^6frac(-1)^n+1n 7^n+E_2 = frac9425897058940+E_2 $$
with $|E_2|leq frac18cdot 10^5$ and
$$ log(2) = sum_n=1^15frac1n 2^n+E_3 = frac3197207946126080+E_3 $$
with $|E_3|leq frac210^5$. In particular
$$frac1130463162168120922789888000-frac9425897058940+3cdot frac3197207946126080=colorgreen2.4862071ldots $$
is an approximation (a lower bound) of $log(7)+cos(1)$ within the required accuracy.
An improved approach is to write
$$ log(7)+cos(1) = 3log(2)+logleft(1-frac18right)+cos(1), $$
approximate $cos(1)$ and $logleft(1-frac18right)$ via Maclaurin series and approximate $log(2)$ via $0leq int_0^1fracx^n(1-x)^n1+x,dxleqfrac14^n$. With $n=5$ we already get $log(2)approx frac23293360$ with an error $leq 8cdot 10^-6$.
add a comment |Â
up vote
2
down vote
accepted
By writing
$$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+cos(1) $$
we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$. We have
$$ cos(1)=sum_n=0^8frac(-1)^n(2n)!+E_1 = frac1130463162168120922789888000+E_1 $$
with $|E_1|leq frac110!$. Similarly
$$ logleft(1+frac17right) = sum_n=1^6frac(-1)^n+1n 7^n+E_2 = frac9425897058940+E_2 $$
with $|E_2|leq frac18cdot 10^5$ and
$$ log(2) = sum_n=1^15frac1n 2^n+E_3 = frac3197207946126080+E_3 $$
with $|E_3|leq frac210^5$. In particular
$$frac1130463162168120922789888000-frac9425897058940+3cdot frac3197207946126080=colorgreen2.4862071ldots $$
is an approximation (a lower bound) of $log(7)+cos(1)$ within the required accuracy.
An improved approach is to write
$$ log(7)+cos(1) = 3log(2)+logleft(1-frac18right)+cos(1), $$
approximate $cos(1)$ and $logleft(1-frac18right)$ via Maclaurin series and approximate $log(2)$ via $0leq int_0^1fracx^n(1-x)^n1+x,dxleqfrac14^n$. With $n=5$ we already get $log(2)approx frac23293360$ with an error $leq 8cdot 10^-6$.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
By writing
$$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+cos(1) $$
we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$. We have
$$ cos(1)=sum_n=0^8frac(-1)^n(2n)!+E_1 = frac1130463162168120922789888000+E_1 $$
with $|E_1|leq frac110!$. Similarly
$$ logleft(1+frac17right) = sum_n=1^6frac(-1)^n+1n 7^n+E_2 = frac9425897058940+E_2 $$
with $|E_2|leq frac18cdot 10^5$ and
$$ log(2) = sum_n=1^15frac1n 2^n+E_3 = frac3197207946126080+E_3 $$
with $|E_3|leq frac210^5$. In particular
$$frac1130463162168120922789888000-frac9425897058940+3cdot frac3197207946126080=colorgreen2.4862071ldots $$
is an approximation (a lower bound) of $log(7)+cos(1)$ within the required accuracy.
An improved approach is to write
$$ log(7)+cos(1) = 3log(2)+logleft(1-frac18right)+cos(1), $$
approximate $cos(1)$ and $logleft(1-frac18right)$ via Maclaurin series and approximate $log(2)$ via $0leq int_0^1fracx^n(1-x)^n1+x,dxleqfrac14^n$. With $n=5$ we already get $log(2)approx frac23293360$ with an error $leq 8cdot 10^-6$.
By writing
$$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+cos(1) $$
we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$. We have
$$ cos(1)=sum_n=0^8frac(-1)^n(2n)!+E_1 = frac1130463162168120922789888000+E_1 $$
with $|E_1|leq frac110!$. Similarly
$$ logleft(1+frac17right) = sum_n=1^6frac(-1)^n+1n 7^n+E_2 = frac9425897058940+E_2 $$
with $|E_2|leq frac18cdot 10^5$ and
$$ log(2) = sum_n=1^15frac1n 2^n+E_3 = frac3197207946126080+E_3 $$
with $|E_3|leq frac210^5$. In particular
$$frac1130463162168120922789888000-frac9425897058940+3cdot frac3197207946126080=colorgreen2.4862071ldots $$
is an approximation (a lower bound) of $log(7)+cos(1)$ within the required accuracy.
An improved approach is to write
$$ log(7)+cos(1) = 3log(2)+logleft(1-frac18right)+cos(1), $$
approximate $cos(1)$ and $logleft(1-frac18right)$ via Maclaurin series and approximate $log(2)$ via $0leq int_0^1fracx^n(1-x)^n1+x,dxleqfrac14^n$. With $n=5$ we already get $log(2)approx frac23293360$ with an error $leq 8cdot 10^-6$.
edited Aug 13 at 11:14
answered Aug 13 at 10:56
Jack D'Aurizioâ¦
271k31266632
271k31266632
add a comment |Â
add a comment |Â
up vote
3
down vote
Consider
$$
log(1+x)=x-fracx^22+fracx^33-dotsb=sum_nge1(-1)^n-1fracx^nn
$$
and
$$
log(1-x)=-x-fracx^22-fracx^33-dotsb=-sum_nge1fracx^nn
$$
which holds for $-1<x<1$. Subtracting the second from the first yields
$$
logfrac1+x1-x=2sum_nge0fracx^2n+12n+1
$$
The equation
$$
frac1+x1-x=7
$$
yields $x=3/4$.
Now use the Lagrange remainder formula to ensure that the errors in the Taylor polynomial for $logfrac1+x1-x$ for $x=3/4$ is less than $10^-4/2$ and the in the Taylor polynomial for $cos x$ for $x=1$ is again less than $10^-4/2$.
add a comment |Â
up vote
3
down vote
Consider
$$
log(1+x)=x-fracx^22+fracx^33-dotsb=sum_nge1(-1)^n-1fracx^nn
$$
and
$$
log(1-x)=-x-fracx^22-fracx^33-dotsb=-sum_nge1fracx^nn
$$
which holds for $-1<x<1$. Subtracting the second from the first yields
$$
logfrac1+x1-x=2sum_nge0fracx^2n+12n+1
$$
The equation
$$
frac1+x1-x=7
$$
yields $x=3/4$.
Now use the Lagrange remainder formula to ensure that the errors in the Taylor polynomial for $logfrac1+x1-x$ for $x=3/4$ is less than $10^-4/2$ and the in the Taylor polynomial for $cos x$ for $x=1$ is again less than $10^-4/2$.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Consider
$$
log(1+x)=x-fracx^22+fracx^33-dotsb=sum_nge1(-1)^n-1fracx^nn
$$
and
$$
log(1-x)=-x-fracx^22-fracx^33-dotsb=-sum_nge1fracx^nn
$$
which holds for $-1<x<1$. Subtracting the second from the first yields
$$
logfrac1+x1-x=2sum_nge0fracx^2n+12n+1
$$
The equation
$$
frac1+x1-x=7
$$
yields $x=3/4$.
Now use the Lagrange remainder formula to ensure that the errors in the Taylor polynomial for $logfrac1+x1-x$ for $x=3/4$ is less than $10^-4/2$ and the in the Taylor polynomial for $cos x$ for $x=1$ is again less than $10^-4/2$.
Consider
$$
log(1+x)=x-fracx^22+fracx^33-dotsb=sum_nge1(-1)^n-1fracx^nn
$$
and
$$
log(1-x)=-x-fracx^22-fracx^33-dotsb=-sum_nge1fracx^nn
$$
which holds for $-1<x<1$. Subtracting the second from the first yields
$$
logfrac1+x1-x=2sum_nge0fracx^2n+12n+1
$$
The equation
$$
frac1+x1-x=7
$$
yields $x=3/4$.
Now use the Lagrange remainder formula to ensure that the errors in the Taylor polynomial for $logfrac1+x1-x$ for $x=3/4$ is less than $10^-4/2$ and the in the Taylor polynomial for $cos x$ for $x=1$ is again less than $10^-4/2$.
answered Aug 13 at 10:30
egreg
165k1180187
165k1180187
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2881202%2fapproximate-log7-cos1-with-an-error-of-less-than-10-4%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
If you are free in the method, I would suggest to solve $e^x=7$ with newton's method rather than use the taylor-expansion of $ln(x)$.
â Peter
Aug 13 at 10:09
@Peter I have never used it in an exercise. Can you show me how to use it? Thank you
â F.inc
Aug 13 at 10:23
2
By writing $$ log(7)+cos(1) = -logleft(1+tfrac17right)-3logleft(1-tfrac12right)+2cos^2tfrac12-1 $$ we may easily use few terms of the Maclaurin series of $log(1pm x)$ and $cos x$.
â Jack D'Aurizioâ¦
Aug 13 at 10:27
In order to solve $e^x=7$ through Newton's method you still need to compute exponentials, so the problem is pretty much the same.
â Jack D'Aurizioâ¦
Aug 13 at 10:30
1
@Peter: $7=8/ frac87 = 2^3/left(1+frac17right) = left(1-frac12right)^-3left(1+frac17right)^-1$.
â Jack D'Aurizioâ¦
Aug 13 at 10:59