How to evaluate this function?
$begingroup$
I’m trying to evaluate
y[t] = InverseFunction[ NIntegrate[Sqrt[2]/( -8+Exp[y]+2Exp[-y]), {y,0,t}]]
Some of the problems I’m facing, is that i’d like to get the integral’s result in terms of t as a definite integral.
Any help to get y[0], y[1] and y’[0] ?
calculus-and-analysis numerical-integration numerics
$endgroup$
add a comment |
$begingroup$
I’m trying to evaluate
y[t] = InverseFunction[ NIntegrate[Sqrt[2]/( -8+Exp[y]+2Exp[-y]), {y,0,t}]]
Some of the problems I’m facing, is that i’d like to get the integral’s result in terms of t as a definite integral.
Any help to get y[0], y[1] and y’[0] ?
calculus-and-analysis numerical-integration numerics
$endgroup$
add a comment |
$begingroup$
I’m trying to evaluate
y[t] = InverseFunction[ NIntegrate[Sqrt[2]/( -8+Exp[y]+2Exp[-y]), {y,0,t}]]
Some of the problems I’m facing, is that i’d like to get the integral’s result in terms of t as a definite integral.
Any help to get y[0], y[1] and y’[0] ?
calculus-and-analysis numerical-integration numerics
$endgroup$
I’m trying to evaluate
y[t] = InverseFunction[ NIntegrate[Sqrt[2]/( -8+Exp[y]+2Exp[-y]), {y,0,t}]]
Some of the problems I’m facing, is that i’d like to get the integral’s result in terms of t as a definite integral.
Any help to get y[0], y[1] and y’[0] ?
calculus-and-analysis numerical-integration numerics
calculus-and-analysis numerical-integration numerics
edited Apr 21 at 7:10
S.S.
asked Apr 21 at 6:54
S.S.S.S.
1266
1266
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Assuming the integral is not possible to evaluate symbolically, so that Roman's approach was not available, it is still possible to construct an interpolating function solution of the inverse. First, rewrite your relationship as follows:
eqn = y == Inactive[Integrate][Sqrt[2]/(-8+Exp[s]+2Exp[-s]),{s,0,t[y]}];
eqn //TeXForm
$y=int _0^{t(y)}frac{sqrt{2}}{2 e^{-s}+e^s-8}ds$
where I renamed the integration variable to avoid confusion. Then, differentiating with respect to y produces an ODE:
ode = D[eqn, y];
ode //TeXForm
$1=frac{sqrt{2} t'(y)}{2 e^{-t(y)}+e^{t(y)}-8}$
For initial conditions, clearly t[0] == 0. So, we need to solve:
sol = NDSolveValue[{ode, t[0]==0}, t, {y, -1, 1}];
Visualization:
Plot[sol[y], {y, -1, 1}]

Comparison with the exact answer (as provided by Roman):
sol[0]
sol[1]
sol'[0]
0.
-1.33756
-3.53553
vs:
roman[y_] := Log[4-Sqrt[14] Tanh[Sqrt[7] y+ArcTanh[3/Sqrt[14]]]]
roman[0]
roman[1] //N
roman'[0] //N
0
-1.33756
-3.53553
$endgroup$
add a comment |
$begingroup$
No need to do numerical integration, you can do this one analytically.
Start with the integral:
Integrate[Sqrt[2]/(-8 + Exp[y] + 2 Exp[-y]), {y, 0, t}]
(* ConditionalExpression[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
E^t == 4 || (-4 + E^t)^2 <= 0] *)
It turns out that this result is valid for $ln(4-sqrt{14})<t<ln(4+sqrt{14})$:
Plot[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
{t, Log[4 - Sqrt[14]], Log[4 + Sqrt[14]]}]

Invert it:
Solve[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]) == y, t]
(expression that I simplify by hand to get rid of branches:)
t[y_] = Log[4 - Sqrt[14] Tanh[Sqrt[7] y + ArcTanh[3/Sqrt[14]]]];
Plot[t[y], {y, -1, 1}]

From this you get your points of interest:
t[0]
(* 0 *)
t[1]
(* Log[4 - Sqrt[14] Tanh[Sqrt[7] + ArcTanh[3/Sqrt[14]]]] *)
t'[0]
(* -5/Sqrt[2] *)
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195696%2fhow-to-evaluate-this-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Assuming the integral is not possible to evaluate symbolically, so that Roman's approach was not available, it is still possible to construct an interpolating function solution of the inverse. First, rewrite your relationship as follows:
eqn = y == Inactive[Integrate][Sqrt[2]/(-8+Exp[s]+2Exp[-s]),{s,0,t[y]}];
eqn //TeXForm
$y=int _0^{t(y)}frac{sqrt{2}}{2 e^{-s}+e^s-8}ds$
where I renamed the integration variable to avoid confusion. Then, differentiating with respect to y produces an ODE:
ode = D[eqn, y];
ode //TeXForm
$1=frac{sqrt{2} t'(y)}{2 e^{-t(y)}+e^{t(y)}-8}$
For initial conditions, clearly t[0] == 0. So, we need to solve:
sol = NDSolveValue[{ode, t[0]==0}, t, {y, -1, 1}];
Visualization:
Plot[sol[y], {y, -1, 1}]

Comparison with the exact answer (as provided by Roman):
sol[0]
sol[1]
sol'[0]
0.
-1.33756
-3.53553
vs:
roman[y_] := Log[4-Sqrt[14] Tanh[Sqrt[7] y+ArcTanh[3/Sqrt[14]]]]
roman[0]
roman[1] //N
roman'[0] //N
0
-1.33756
-3.53553
$endgroup$
add a comment |
$begingroup$
Assuming the integral is not possible to evaluate symbolically, so that Roman's approach was not available, it is still possible to construct an interpolating function solution of the inverse. First, rewrite your relationship as follows:
eqn = y == Inactive[Integrate][Sqrt[2]/(-8+Exp[s]+2Exp[-s]),{s,0,t[y]}];
eqn //TeXForm
$y=int _0^{t(y)}frac{sqrt{2}}{2 e^{-s}+e^s-8}ds$
where I renamed the integration variable to avoid confusion. Then, differentiating with respect to y produces an ODE:
ode = D[eqn, y];
ode //TeXForm
$1=frac{sqrt{2} t'(y)}{2 e^{-t(y)}+e^{t(y)}-8}$
For initial conditions, clearly t[0] == 0. So, we need to solve:
sol = NDSolveValue[{ode, t[0]==0}, t, {y, -1, 1}];
Visualization:
Plot[sol[y], {y, -1, 1}]

Comparison with the exact answer (as provided by Roman):
sol[0]
sol[1]
sol'[0]
0.
-1.33756
-3.53553
vs:
roman[y_] := Log[4-Sqrt[14] Tanh[Sqrt[7] y+ArcTanh[3/Sqrt[14]]]]
roman[0]
roman[1] //N
roman'[0] //N
0
-1.33756
-3.53553
$endgroup$
add a comment |
$begingroup$
Assuming the integral is not possible to evaluate symbolically, so that Roman's approach was not available, it is still possible to construct an interpolating function solution of the inverse. First, rewrite your relationship as follows:
eqn = y == Inactive[Integrate][Sqrt[2]/(-8+Exp[s]+2Exp[-s]),{s,0,t[y]}];
eqn //TeXForm
$y=int _0^{t(y)}frac{sqrt{2}}{2 e^{-s}+e^s-8}ds$
where I renamed the integration variable to avoid confusion. Then, differentiating with respect to y produces an ODE:
ode = D[eqn, y];
ode //TeXForm
$1=frac{sqrt{2} t'(y)}{2 e^{-t(y)}+e^{t(y)}-8}$
For initial conditions, clearly t[0] == 0. So, we need to solve:
sol = NDSolveValue[{ode, t[0]==0}, t, {y, -1, 1}];
Visualization:
Plot[sol[y], {y, -1, 1}]

Comparison with the exact answer (as provided by Roman):
sol[0]
sol[1]
sol'[0]
0.
-1.33756
-3.53553
vs:
roman[y_] := Log[4-Sqrt[14] Tanh[Sqrt[7] y+ArcTanh[3/Sqrt[14]]]]
roman[0]
roman[1] //N
roman'[0] //N
0
-1.33756
-3.53553
$endgroup$
Assuming the integral is not possible to evaluate symbolically, so that Roman's approach was not available, it is still possible to construct an interpolating function solution of the inverse. First, rewrite your relationship as follows:
eqn = y == Inactive[Integrate][Sqrt[2]/(-8+Exp[s]+2Exp[-s]),{s,0,t[y]}];
eqn //TeXForm
$y=int _0^{t(y)}frac{sqrt{2}}{2 e^{-s}+e^s-8}ds$
where I renamed the integration variable to avoid confusion. Then, differentiating with respect to y produces an ODE:
ode = D[eqn, y];
ode //TeXForm
$1=frac{sqrt{2} t'(y)}{2 e^{-t(y)}+e^{t(y)}-8}$
For initial conditions, clearly t[0] == 0. So, we need to solve:
sol = NDSolveValue[{ode, t[0]==0}, t, {y, -1, 1}];
Visualization:
Plot[sol[y], {y, -1, 1}]

Comparison with the exact answer (as provided by Roman):
sol[0]
sol[1]
sol'[0]
0.
-1.33756
-3.53553
vs:
roman[y_] := Log[4-Sqrt[14] Tanh[Sqrt[7] y+ArcTanh[3/Sqrt[14]]]]
roman[0]
roman[1] //N
roman'[0] //N
0
-1.33756
-3.53553
answered Apr 21 at 15:17
Carl WollCarl Woll
75.8k3100198
75.8k3100198
add a comment |
add a comment |
$begingroup$
No need to do numerical integration, you can do this one analytically.
Start with the integral:
Integrate[Sqrt[2]/(-8 + Exp[y] + 2 Exp[-y]), {y, 0, t}]
(* ConditionalExpression[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
E^t == 4 || (-4 + E^t)^2 <= 0] *)
It turns out that this result is valid for $ln(4-sqrt{14})<t<ln(4+sqrt{14})$:
Plot[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
{t, Log[4 - Sqrt[14]], Log[4 + Sqrt[14]]}]

Invert it:
Solve[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]) == y, t]
(expression that I simplify by hand to get rid of branches:)
t[y_] = Log[4 - Sqrt[14] Tanh[Sqrt[7] y + ArcTanh[3/Sqrt[14]]]];
Plot[t[y], {y, -1, 1}]

From this you get your points of interest:
t[0]
(* 0 *)
t[1]
(* Log[4 - Sqrt[14] Tanh[Sqrt[7] + ArcTanh[3/Sqrt[14]]]] *)
t'[0]
(* -5/Sqrt[2] *)
$endgroup$
add a comment |
$begingroup$
No need to do numerical integration, you can do this one analytically.
Start with the integral:
Integrate[Sqrt[2]/(-8 + Exp[y] + 2 Exp[-y]), {y, 0, t}]
(* ConditionalExpression[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
E^t == 4 || (-4 + E^t)^2 <= 0] *)
It turns out that this result is valid for $ln(4-sqrt{14})<t<ln(4+sqrt{14})$:
Plot[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
{t, Log[4 - Sqrt[14]], Log[4 + Sqrt[14]]}]

Invert it:
Solve[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]) == y, t]
(expression that I simplify by hand to get rid of branches:)
t[y_] = Log[4 - Sqrt[14] Tanh[Sqrt[7] y + ArcTanh[3/Sqrt[14]]]];
Plot[t[y], {y, -1, 1}]

From this you get your points of interest:
t[0]
(* 0 *)
t[1]
(* Log[4 - Sqrt[14] Tanh[Sqrt[7] + ArcTanh[3/Sqrt[14]]]] *)
t'[0]
(* -5/Sqrt[2] *)
$endgroup$
add a comment |
$begingroup$
No need to do numerical integration, you can do this one analytically.
Start with the integral:
Integrate[Sqrt[2]/(-8 + Exp[y] + 2 Exp[-y]), {y, 0, t}]
(* ConditionalExpression[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
E^t == 4 || (-4 + E^t)^2 <= 0] *)
It turns out that this result is valid for $ln(4-sqrt{14})<t<ln(4+sqrt{14})$:
Plot[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
{t, Log[4 - Sqrt[14]], Log[4 + Sqrt[14]]}]

Invert it:
Solve[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]) == y, t]
(expression that I simplify by hand to get rid of branches:)
t[y_] = Log[4 - Sqrt[14] Tanh[Sqrt[7] y + ArcTanh[3/Sqrt[14]]]];
Plot[t[y], {y, -1, 1}]

From this you get your points of interest:
t[0]
(* 0 *)
t[1]
(* Log[4 - Sqrt[14] Tanh[Sqrt[7] + ArcTanh[3/Sqrt[14]]]] *)
t'[0]
(* -5/Sqrt[2] *)
$endgroup$
No need to do numerical integration, you can do this one analytically.
Start with the integral:
Integrate[Sqrt[2]/(-8 + Exp[y] + 2 Exp[-y]), {y, 0, t}]
(* ConditionalExpression[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
E^t == 4 || (-4 + E^t)^2 <= 0] *)
It turns out that this result is valid for $ln(4-sqrt{14})<t<ln(4+sqrt{14})$:
Plot[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]),
{t, Log[4 - Sqrt[14]], Log[4 + Sqrt[14]]}]

Invert it:
Solve[-((ArcTanh[3/Sqrt[14]] + ArcTanh[(-4 + E^t)/Sqrt[14]])/Sqrt[7]) == y, t]
(expression that I simplify by hand to get rid of branches:)
t[y_] = Log[4 - Sqrt[14] Tanh[Sqrt[7] y + ArcTanh[3/Sqrt[14]]]];
Plot[t[y], {y, -1, 1}]

From this you get your points of interest:
t[0]
(* 0 *)
t[1]
(* Log[4 - Sqrt[14] Tanh[Sqrt[7] + ArcTanh[3/Sqrt[14]]]] *)
t'[0]
(* -5/Sqrt[2] *)
edited Apr 21 at 8:29
answered Apr 21 at 8:11
RomanRoman
6,07611132
6,07611132
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195696%2fhow-to-evaluate-this-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown