Mathematica gives an unexpected answer for Integrate
I need to integrate the following:
begin{equation}tag{1}
frac{sqrt{C + (1 - C) x^3}}{x},
end{equation}
where $0 < C < 1$ and $x$ is a positive variable (then $x^3 ge 0$). When I integrate:
Integrate[Sqrt[C + (1 - C) x^3]/x, x, Assumptions -> 0 < C < 1]
I get this answer:
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
This answer is wrong because the term inside parenthesis (inside the argtanh) is larger than 1, which invalidates the answer.
So how can I get the proper integration of (1), using Mathematica?
EDIT: Actually, what I need is to find the general solution of the following differential equation ($lambda$ is a positive constant):
begin{equation}tag{3}
frac{d a}{d t} = pm , frac{lambda , a}{sqrt{C + (1 - C) , a^3}},
end{equation}
i.e. the function $a(t)$ or the time $t(a)$.
differential-equations calculus-and-analysis functions trigonometry integral-equations
add a comment |
I need to integrate the following:
begin{equation}tag{1}
frac{sqrt{C + (1 - C) x^3}}{x},
end{equation}
where $0 < C < 1$ and $x$ is a positive variable (then $x^3 ge 0$). When I integrate:
Integrate[Sqrt[C + (1 - C) x^3]/x, x, Assumptions -> 0 < C < 1]
I get this answer:
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
This answer is wrong because the term inside parenthesis (inside the argtanh) is larger than 1, which invalidates the answer.
So how can I get the proper integration of (1), using Mathematica?
EDIT: Actually, what I need is to find the general solution of the following differential equation ($lambda$ is a positive constant):
begin{equation}tag{3}
frac{d a}{d t} = pm , frac{lambda , a}{sqrt{C + (1 - C) , a^3}},
end{equation}
i.e. the function $a(t)$ or the time $t(a)$.
differential-equations calculus-and-analysis functions trigonometry integral-equations
When evaluating a definite integral don't the imaginary parts cancel out?
– JimB
6 hours ago
@JimB, I need the general solution on the indefinite integration, since I don't know the limits of the variable $x$ (except that $x > 0$). It's the solution of some differential equation.
– Cham
6 hours ago
You should change the subject line of the question from "wrong" to perhaps "unexpected" sinceAssuming[{0<C<1, x>=0}, Sqrt[C+(1-C) x^3]/x == D[Integrate[Sqrt[C+(1-C) x^3]/x, x], x] // Simplify]
evaluates toTrue
– Bob Hanlon
2 hours ago
Tha antiderivative shown is fine. Can check by differentiation:In[646]:= i0 = Sqrt[C + (1 - C) x^3]/x; i1 = Integrate[i0, x]; Simplify[D[i1, x] - i0] Out[648]= 0
– Daniel Lichtblau
47 mins ago
add a comment |
I need to integrate the following:
begin{equation}tag{1}
frac{sqrt{C + (1 - C) x^3}}{x},
end{equation}
where $0 < C < 1$ and $x$ is a positive variable (then $x^3 ge 0$). When I integrate:
Integrate[Sqrt[C + (1 - C) x^3]/x, x, Assumptions -> 0 < C < 1]
I get this answer:
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
This answer is wrong because the term inside parenthesis (inside the argtanh) is larger than 1, which invalidates the answer.
So how can I get the proper integration of (1), using Mathematica?
EDIT: Actually, what I need is to find the general solution of the following differential equation ($lambda$ is a positive constant):
begin{equation}tag{3}
frac{d a}{d t} = pm , frac{lambda , a}{sqrt{C + (1 - C) , a^3}},
end{equation}
i.e. the function $a(t)$ or the time $t(a)$.
differential-equations calculus-and-analysis functions trigonometry integral-equations
I need to integrate the following:
begin{equation}tag{1}
frac{sqrt{C + (1 - C) x^3}}{x},
end{equation}
where $0 < C < 1$ and $x$ is a positive variable (then $x^3 ge 0$). When I integrate:
Integrate[Sqrt[C + (1 - C) x^3]/x, x, Assumptions -> 0 < C < 1]
I get this answer:
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
This answer is wrong because the term inside parenthesis (inside the argtanh) is larger than 1, which invalidates the answer.
So how can I get the proper integration of (1), using Mathematica?
EDIT: Actually, what I need is to find the general solution of the following differential equation ($lambda$ is a positive constant):
begin{equation}tag{3}
frac{d a}{d t} = pm , frac{lambda , a}{sqrt{C + (1 - C) , a^3}},
end{equation}
i.e. the function $a(t)$ or the time $t(a)$.
differential-equations calculus-and-analysis functions trigonometry integral-equations
differential-equations calculus-and-analysis functions trigonometry integral-equations
edited 32 mins ago
Cham
asked 6 hours ago
ChamCham
1,4371126
1,4371126
When evaluating a definite integral don't the imaginary parts cancel out?
– JimB
6 hours ago
@JimB, I need the general solution on the indefinite integration, since I don't know the limits of the variable $x$ (except that $x > 0$). It's the solution of some differential equation.
– Cham
6 hours ago
You should change the subject line of the question from "wrong" to perhaps "unexpected" sinceAssuming[{0<C<1, x>=0}, Sqrt[C+(1-C) x^3]/x == D[Integrate[Sqrt[C+(1-C) x^3]/x, x], x] // Simplify]
evaluates toTrue
– Bob Hanlon
2 hours ago
Tha antiderivative shown is fine. Can check by differentiation:In[646]:= i0 = Sqrt[C + (1 - C) x^3]/x; i1 = Integrate[i0, x]; Simplify[D[i1, x] - i0] Out[648]= 0
– Daniel Lichtblau
47 mins ago
add a comment |
When evaluating a definite integral don't the imaginary parts cancel out?
– JimB
6 hours ago
@JimB, I need the general solution on the indefinite integration, since I don't know the limits of the variable $x$ (except that $x > 0$). It's the solution of some differential equation.
– Cham
6 hours ago
You should change the subject line of the question from "wrong" to perhaps "unexpected" sinceAssuming[{0<C<1, x>=0}, Sqrt[C+(1-C) x^3]/x == D[Integrate[Sqrt[C+(1-C) x^3]/x, x], x] // Simplify]
evaluates toTrue
– Bob Hanlon
2 hours ago
Tha antiderivative shown is fine. Can check by differentiation:In[646]:= i0 = Sqrt[C + (1 - C) x^3]/x; i1 = Integrate[i0, x]; Simplify[D[i1, x] - i0] Out[648]= 0
– Daniel Lichtblau
47 mins ago
When evaluating a definite integral don't the imaginary parts cancel out?
– JimB
6 hours ago
When evaluating a definite integral don't the imaginary parts cancel out?
– JimB
6 hours ago
@JimB, I need the general solution on the indefinite integration, since I don't know the limits of the variable $x$ (except that $x > 0$). It's the solution of some differential equation.
– Cham
6 hours ago
@JimB, I need the general solution on the indefinite integration, since I don't know the limits of the variable $x$ (except that $x > 0$). It's the solution of some differential equation.
– Cham
6 hours ago
You should change the subject line of the question from "wrong" to perhaps "unexpected" since
Assuming[{0<C<1, x>=0}, Sqrt[C+(1-C) x^3]/x == D[Integrate[Sqrt[C+(1-C) x^3]/x, x], x] // Simplify]
evaluates to True
– Bob Hanlon
2 hours ago
You should change the subject line of the question from "wrong" to perhaps "unexpected" since
Assuming[{0<C<1, x>=0}, Sqrt[C+(1-C) x^3]/x == D[Integrate[Sqrt[C+(1-C) x^3]/x, x], x] // Simplify]
evaluates to True
– Bob Hanlon
2 hours ago
Tha antiderivative shown is fine. Can check by differentiation:
In[646]:= i0 = Sqrt[C + (1 - C) x^3]/x; i1 = Integrate[i0, x]; Simplify[D[i1, x] - i0] Out[648]= 0
– Daniel Lichtblau
47 mins ago
Tha antiderivative shown is fine. Can check by differentiation:
In[646]:= i0 = Sqrt[C + (1 - C) x^3]/x; i1 = Integrate[i0, x]; Simplify[D[i1, x] - i0] Out[648]= 0
– Daniel Lichtblau
47 mins ago
add a comment |
2 Answers
2
active
oldest
votes
$intfrac{sqrt{C + (1 - C) x^3}}{x}dx=intfrac{left(sqrt{C + (1 - C) x^3}right)x^2}{x^3}dx$
Let $C + (1 - C) x^3=u^2$
$3(1 - C) x^2dx=2udu$
$frac{2}{3}intfrac{u^2du}{u^2-C}du$
$frac{2}{3}intleft(1+frac{c}{u^2-C}right)du$
$frac{2}{3}left(u+Cintfrac{du}{u^2-sqrt{C}^2}right)$
$frac{2}{3}left(u-Cfrac{Arctanh(frac{u}{sqrt{C}})}{sqrt{C}}right)$
Substituting back gives
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
FunctionDomain[ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]], x]
-1 < Sqrt[C + x^3 - C x^3]/Sqrt[C] < 1 && -C - x^3 + C x^3 <= 0
Or
ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]] // TrigToExp
-(1/2) Log[1 - Sqrt[C + (1 - C) x^3]/Sqrt[C]] + 1/2 Log[1 + Sqrt[C + (1 - C) x^3]/Sqrt[C]]
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
add a comment |
Here are four five six forms for an antiderivative, the first ad1
being the same as the OP's and complex-valued over the intended domain. The other three four five are real-valued.
ad1 = Integrate[Sqrt[c + (1 - c) x^3]/x, x, Assumptions -> 0 < c < 1]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c + (1 - c) x^3]/Sqrt[c]] *)
The imaginary part of ad
is constant so we can subtract it off (which is the point of @JimB's comment under the OP):
ad2 = ad1 /. {{x -> 1}, {x -> x}} // Differences // First;
Assuming[0 < c < 1 && x > 0,
TrigToExp@ad2 /. {Log[z_] /; Simplify[z < 0] :> Log[-1] + Log[-z]} //
Expand // FullSimplify
]
(*
2/3 (-1 + Sqrt[c + x^3 - c x^3] +
Sqrt[c] ArcTanh[(Sqrt[c] (x^3 - Sqrt[c + x^3 - c x^3]))/(c + x^3)])
*)
Applying the identity,
$$tanh ^{-1}left(frac{1}{z}right) - tanh ^{-1}(z)=frac{i pi}{2} ,,$$
changes ad1
by a constant, which results in another antiderivative:
ad3 = ad1 /. ArcTanh[z_] :> ArcTanh[1/z]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c]/Sqrt[c + (1 - c) x^3]] *)
Rewrite ad3
in terms of logarithms:
ad4 = TrigToExp@ad3 /.
a__ Log[u_] + b__ Log[v_] + w__ /; Times@a == -Times@b :> a Log@Simplify[u/v] + w
(*
2/3 Sqrt[c + x^3 - c x^3] +
1/3 Sqrt[c] Log[(-Sqrt[c] + Sqrt[c + x^3 - c x^3]) /
(Sqrt[c] + Sqrt[c + x^3 - c x^3])]
*)
Check:
D[{ad1, ad2, ad3, ad4}, x] // Simplify
(*
{Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x,
Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x}
*)
Addendum:
Here is a fifth, the real part of ad1
:
ad5 = ComplexExpand[Re[ad1], TargetFunctions -> {Re, Im}] //
Simplify[#, 0 < c < 1 && x > (c/(1 - c))^(1/3)] &
(*
1/6 (4 Sqrt[c + x^3 - c x^3] +
Sqrt[c] Log[(x^3 - c (-2 + x^3) - 2 Sqrt[c (c + x^3 - c x^3)])/c] -
Sqrt[c] Log[(x^3 - c (-2 + x^3) + 2 Sqrt[c (c + x^3 - c x^3)])/c])
*)
Addendum 2:
Doing a line integral within the domain of interest will often give the desired result; however, this time it ran forever, until I turned off GenerateConditions
. The antiderivative comes back in terms of HypergeometricPFQ
which can be simplified with the aid of FunctionExpand
.
Assuming[0 < c < 1 && x > 0 && t > 0,
ad6 = Simplify@ FunctionExpand@
Integrate[Sqrt[c + (1 - c) t^3]/t, {t, 1, x},
Assumptions -> 0 < c < 1 && x > 0, GenerateConditions -> False]
]
(*
1/3 (-2 + 2 Sqrt[c + x^3 - c x^3] + 2 Sqrt[c] Log[1 + 1/Sqrt[c]] +
3 Sqrt[c] Log[x] - 2 Sqrt[c] Log[1 + Sqrt[1 + (-1 + 1/c) x^3]])
*)
(* Check *)
Simplify[D[ad6, x] - Sqrt[c + x^3 - c x^3]/x, 0 < c < 1 && x > 0]
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
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%2f189413%2fmathematica-gives-an-unexpected-answer-for-integrate%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
$intfrac{sqrt{C + (1 - C) x^3}}{x}dx=intfrac{left(sqrt{C + (1 - C) x^3}right)x^2}{x^3}dx$
Let $C + (1 - C) x^3=u^2$
$3(1 - C) x^2dx=2udu$
$frac{2}{3}intfrac{u^2du}{u^2-C}du$
$frac{2}{3}intleft(1+frac{c}{u^2-C}right)du$
$frac{2}{3}left(u+Cintfrac{du}{u^2-sqrt{C}^2}right)$
$frac{2}{3}left(u-Cfrac{Arctanh(frac{u}{sqrt{C}})}{sqrt{C}}right)$
Substituting back gives
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
FunctionDomain[ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]], x]
-1 < Sqrt[C + x^3 - C x^3]/Sqrt[C] < 1 && -C - x^3 + C x^3 <= 0
Or
ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]] // TrigToExp
-(1/2) Log[1 - Sqrt[C + (1 - C) x^3]/Sqrt[C]] + 1/2 Log[1 + Sqrt[C + (1 - C) x^3]/Sqrt[C]]
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
add a comment |
$intfrac{sqrt{C + (1 - C) x^3}}{x}dx=intfrac{left(sqrt{C + (1 - C) x^3}right)x^2}{x^3}dx$
Let $C + (1 - C) x^3=u^2$
$3(1 - C) x^2dx=2udu$
$frac{2}{3}intfrac{u^2du}{u^2-C}du$
$frac{2}{3}intleft(1+frac{c}{u^2-C}right)du$
$frac{2}{3}left(u+Cintfrac{du}{u^2-sqrt{C}^2}right)$
$frac{2}{3}left(u-Cfrac{Arctanh(frac{u}{sqrt{C}})}{sqrt{C}}right)$
Substituting back gives
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
FunctionDomain[ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]], x]
-1 < Sqrt[C + x^3 - C x^3]/Sqrt[C] < 1 && -C - x^3 + C x^3 <= 0
Or
ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]] // TrigToExp
-(1/2) Log[1 - Sqrt[C + (1 - C) x^3]/Sqrt[C]] + 1/2 Log[1 + Sqrt[C + (1 - C) x^3]/Sqrt[C]]
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
add a comment |
$intfrac{sqrt{C + (1 - C) x^3}}{x}dx=intfrac{left(sqrt{C + (1 - C) x^3}right)x^2}{x^3}dx$
Let $C + (1 - C) x^3=u^2$
$3(1 - C) x^2dx=2udu$
$frac{2}{3}intfrac{u^2du}{u^2-C}du$
$frac{2}{3}intleft(1+frac{c}{u^2-C}right)du$
$frac{2}{3}left(u+Cintfrac{du}{u^2-sqrt{C}^2}right)$
$frac{2}{3}left(u-Cfrac{Arctanh(frac{u}{sqrt{C}})}{sqrt{C}}right)$
Substituting back gives
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
FunctionDomain[ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]], x]
-1 < Sqrt[C + x^3 - C x^3]/Sqrt[C] < 1 && -C - x^3 + C x^3 <= 0
Or
ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]] // TrigToExp
-(1/2) Log[1 - Sqrt[C + (1 - C) x^3]/Sqrt[C]] + 1/2 Log[1 + Sqrt[C + (1 - C) x^3]/Sqrt[C]]
$intfrac{sqrt{C + (1 - C) x^3}}{x}dx=intfrac{left(sqrt{C + (1 - C) x^3}right)x^2}{x^3}dx$
Let $C + (1 - C) x^3=u^2$
$3(1 - C) x^2dx=2udu$
$frac{2}{3}intfrac{u^2du}{u^2-C}du$
$frac{2}{3}intleft(1+frac{c}{u^2-C}right)du$
$frac{2}{3}left(u+Cintfrac{du}{u^2-sqrt{C}^2}right)$
$frac{2}{3}left(u-Cfrac{Arctanh(frac{u}{sqrt{C}})}{sqrt{C}}right)$
Substituting back gives
begin{equation}tag{2}
frac{2}{3} sqrt{C + (1 - C), x^3} - frac{2}{3} sqrt{C} , mathrm{argtanh} Big( frac{sqrt{C + (1 - C) , x^3}}{sqrt{C}} Big).
end{equation}
FunctionDomain[ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]], x]
-1 < Sqrt[C + x^3 - C x^3]/Sqrt[C] < 1 && -C - x^3 + C x^3 <= 0
Or
ArcTanh[Sqrt[C + (1 - C) x^3]/Sqrt[C]] // TrigToExp
-(1/2) Log[1 - Sqrt[C + (1 - C) x^3]/Sqrt[C]] + 1/2 Log[1 + Sqrt[C + (1 - C) x^3]/Sqrt[C]]
edited 5 hours ago
answered 5 hours ago
Okkes DulgerciOkkes Dulgerci
4,2801816
4,2801816
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
add a comment |
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
There's still a problem with the argument of arctanh.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
I think it's better to split the integral of $frac{1}{u^2 - C}$ in two parts : $frac{1}{u - sqrt{C}} - frac{1}{u + sqrt{C}}$, then integration gives a $ln{dots}$.
– Cham
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
They are equivalent..
– Okkes Dulgerci
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
My solution appears to be this: begin{equation} frac{2 u}{3 sqrt{C}} + frac{1}{3} , ln{Big(frac{u - sqrt{C}}{u + sqrt{C}}Big)},end{equation} which is good since $u ge sqrt{C}$.
– Cham
5 hours ago
add a comment |
Here are four five six forms for an antiderivative, the first ad1
being the same as the OP's and complex-valued over the intended domain. The other three four five are real-valued.
ad1 = Integrate[Sqrt[c + (1 - c) x^3]/x, x, Assumptions -> 0 < c < 1]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c + (1 - c) x^3]/Sqrt[c]] *)
The imaginary part of ad
is constant so we can subtract it off (which is the point of @JimB's comment under the OP):
ad2 = ad1 /. {{x -> 1}, {x -> x}} // Differences // First;
Assuming[0 < c < 1 && x > 0,
TrigToExp@ad2 /. {Log[z_] /; Simplify[z < 0] :> Log[-1] + Log[-z]} //
Expand // FullSimplify
]
(*
2/3 (-1 + Sqrt[c + x^3 - c x^3] +
Sqrt[c] ArcTanh[(Sqrt[c] (x^3 - Sqrt[c + x^3 - c x^3]))/(c + x^3)])
*)
Applying the identity,
$$tanh ^{-1}left(frac{1}{z}right) - tanh ^{-1}(z)=frac{i pi}{2} ,,$$
changes ad1
by a constant, which results in another antiderivative:
ad3 = ad1 /. ArcTanh[z_] :> ArcTanh[1/z]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c]/Sqrt[c + (1 - c) x^3]] *)
Rewrite ad3
in terms of logarithms:
ad4 = TrigToExp@ad3 /.
a__ Log[u_] + b__ Log[v_] + w__ /; Times@a == -Times@b :> a Log@Simplify[u/v] + w
(*
2/3 Sqrt[c + x^3 - c x^3] +
1/3 Sqrt[c] Log[(-Sqrt[c] + Sqrt[c + x^3 - c x^3]) /
(Sqrt[c] + Sqrt[c + x^3 - c x^3])]
*)
Check:
D[{ad1, ad2, ad3, ad4}, x] // Simplify
(*
{Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x,
Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x}
*)
Addendum:
Here is a fifth, the real part of ad1
:
ad5 = ComplexExpand[Re[ad1], TargetFunctions -> {Re, Im}] //
Simplify[#, 0 < c < 1 && x > (c/(1 - c))^(1/3)] &
(*
1/6 (4 Sqrt[c + x^3 - c x^3] +
Sqrt[c] Log[(x^3 - c (-2 + x^3) - 2 Sqrt[c (c + x^3 - c x^3)])/c] -
Sqrt[c] Log[(x^3 - c (-2 + x^3) + 2 Sqrt[c (c + x^3 - c x^3)])/c])
*)
Addendum 2:
Doing a line integral within the domain of interest will often give the desired result; however, this time it ran forever, until I turned off GenerateConditions
. The antiderivative comes back in terms of HypergeometricPFQ
which can be simplified with the aid of FunctionExpand
.
Assuming[0 < c < 1 && x > 0 && t > 0,
ad6 = Simplify@ FunctionExpand@
Integrate[Sqrt[c + (1 - c) t^3]/t, {t, 1, x},
Assumptions -> 0 < c < 1 && x > 0, GenerateConditions -> False]
]
(*
1/3 (-2 + 2 Sqrt[c + x^3 - c x^3] + 2 Sqrt[c] Log[1 + 1/Sqrt[c]] +
3 Sqrt[c] Log[x] - 2 Sqrt[c] Log[1 + Sqrt[1 + (-1 + 1/c) x^3]])
*)
(* Check *)
Simplify[D[ad6, x] - Sqrt[c + x^3 - c x^3]/x, 0 < c < 1 && x > 0]
add a comment |
Here are four five six forms for an antiderivative, the first ad1
being the same as the OP's and complex-valued over the intended domain. The other three four five are real-valued.
ad1 = Integrate[Sqrt[c + (1 - c) x^3]/x, x, Assumptions -> 0 < c < 1]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c + (1 - c) x^3]/Sqrt[c]] *)
The imaginary part of ad
is constant so we can subtract it off (which is the point of @JimB's comment under the OP):
ad2 = ad1 /. {{x -> 1}, {x -> x}} // Differences // First;
Assuming[0 < c < 1 && x > 0,
TrigToExp@ad2 /. {Log[z_] /; Simplify[z < 0] :> Log[-1] + Log[-z]} //
Expand // FullSimplify
]
(*
2/3 (-1 + Sqrt[c + x^3 - c x^3] +
Sqrt[c] ArcTanh[(Sqrt[c] (x^3 - Sqrt[c + x^3 - c x^3]))/(c + x^3)])
*)
Applying the identity,
$$tanh ^{-1}left(frac{1}{z}right) - tanh ^{-1}(z)=frac{i pi}{2} ,,$$
changes ad1
by a constant, which results in another antiderivative:
ad3 = ad1 /. ArcTanh[z_] :> ArcTanh[1/z]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c]/Sqrt[c + (1 - c) x^3]] *)
Rewrite ad3
in terms of logarithms:
ad4 = TrigToExp@ad3 /.
a__ Log[u_] + b__ Log[v_] + w__ /; Times@a == -Times@b :> a Log@Simplify[u/v] + w
(*
2/3 Sqrt[c + x^3 - c x^3] +
1/3 Sqrt[c] Log[(-Sqrt[c] + Sqrt[c + x^3 - c x^3]) /
(Sqrt[c] + Sqrt[c + x^3 - c x^3])]
*)
Check:
D[{ad1, ad2, ad3, ad4}, x] // Simplify
(*
{Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x,
Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x}
*)
Addendum:
Here is a fifth, the real part of ad1
:
ad5 = ComplexExpand[Re[ad1], TargetFunctions -> {Re, Im}] //
Simplify[#, 0 < c < 1 && x > (c/(1 - c))^(1/3)] &
(*
1/6 (4 Sqrt[c + x^3 - c x^3] +
Sqrt[c] Log[(x^3 - c (-2 + x^3) - 2 Sqrt[c (c + x^3 - c x^3)])/c] -
Sqrt[c] Log[(x^3 - c (-2 + x^3) + 2 Sqrt[c (c + x^3 - c x^3)])/c])
*)
Addendum 2:
Doing a line integral within the domain of interest will often give the desired result; however, this time it ran forever, until I turned off GenerateConditions
. The antiderivative comes back in terms of HypergeometricPFQ
which can be simplified with the aid of FunctionExpand
.
Assuming[0 < c < 1 && x > 0 && t > 0,
ad6 = Simplify@ FunctionExpand@
Integrate[Sqrt[c + (1 - c) t^3]/t, {t, 1, x},
Assumptions -> 0 < c < 1 && x > 0, GenerateConditions -> False]
]
(*
1/3 (-2 + 2 Sqrt[c + x^3 - c x^3] + 2 Sqrt[c] Log[1 + 1/Sqrt[c]] +
3 Sqrt[c] Log[x] - 2 Sqrt[c] Log[1 + Sqrt[1 + (-1 + 1/c) x^3]])
*)
(* Check *)
Simplify[D[ad6, x] - Sqrt[c + x^3 - c x^3]/x, 0 < c < 1 && x > 0]
add a comment |
Here are four five six forms for an antiderivative, the first ad1
being the same as the OP's and complex-valued over the intended domain. The other three four five are real-valued.
ad1 = Integrate[Sqrt[c + (1 - c) x^3]/x, x, Assumptions -> 0 < c < 1]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c + (1 - c) x^3]/Sqrt[c]] *)
The imaginary part of ad
is constant so we can subtract it off (which is the point of @JimB's comment under the OP):
ad2 = ad1 /. {{x -> 1}, {x -> x}} // Differences // First;
Assuming[0 < c < 1 && x > 0,
TrigToExp@ad2 /. {Log[z_] /; Simplify[z < 0] :> Log[-1] + Log[-z]} //
Expand // FullSimplify
]
(*
2/3 (-1 + Sqrt[c + x^3 - c x^3] +
Sqrt[c] ArcTanh[(Sqrt[c] (x^3 - Sqrt[c + x^3 - c x^3]))/(c + x^3)])
*)
Applying the identity,
$$tanh ^{-1}left(frac{1}{z}right) - tanh ^{-1}(z)=frac{i pi}{2} ,,$$
changes ad1
by a constant, which results in another antiderivative:
ad3 = ad1 /. ArcTanh[z_] :> ArcTanh[1/z]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c]/Sqrt[c + (1 - c) x^3]] *)
Rewrite ad3
in terms of logarithms:
ad4 = TrigToExp@ad3 /.
a__ Log[u_] + b__ Log[v_] + w__ /; Times@a == -Times@b :> a Log@Simplify[u/v] + w
(*
2/3 Sqrt[c + x^3 - c x^3] +
1/3 Sqrt[c] Log[(-Sqrt[c] + Sqrt[c + x^3 - c x^3]) /
(Sqrt[c] + Sqrt[c + x^3 - c x^3])]
*)
Check:
D[{ad1, ad2, ad3, ad4}, x] // Simplify
(*
{Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x,
Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x}
*)
Addendum:
Here is a fifth, the real part of ad1
:
ad5 = ComplexExpand[Re[ad1], TargetFunctions -> {Re, Im}] //
Simplify[#, 0 < c < 1 && x > (c/(1 - c))^(1/3)] &
(*
1/6 (4 Sqrt[c + x^3 - c x^3] +
Sqrt[c] Log[(x^3 - c (-2 + x^3) - 2 Sqrt[c (c + x^3 - c x^3)])/c] -
Sqrt[c] Log[(x^3 - c (-2 + x^3) + 2 Sqrt[c (c + x^3 - c x^3)])/c])
*)
Addendum 2:
Doing a line integral within the domain of interest will often give the desired result; however, this time it ran forever, until I turned off GenerateConditions
. The antiderivative comes back in terms of HypergeometricPFQ
which can be simplified with the aid of FunctionExpand
.
Assuming[0 < c < 1 && x > 0 && t > 0,
ad6 = Simplify@ FunctionExpand@
Integrate[Sqrt[c + (1 - c) t^3]/t, {t, 1, x},
Assumptions -> 0 < c < 1 && x > 0, GenerateConditions -> False]
]
(*
1/3 (-2 + 2 Sqrt[c + x^3 - c x^3] + 2 Sqrt[c] Log[1 + 1/Sqrt[c]] +
3 Sqrt[c] Log[x] - 2 Sqrt[c] Log[1 + Sqrt[1 + (-1 + 1/c) x^3]])
*)
(* Check *)
Simplify[D[ad6, x] - Sqrt[c + x^3 - c x^3]/x, 0 < c < 1 && x > 0]
Here are four five six forms for an antiderivative, the first ad1
being the same as the OP's and complex-valued over the intended domain. The other three four five are real-valued.
ad1 = Integrate[Sqrt[c + (1 - c) x^3]/x, x, Assumptions -> 0 < c < 1]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c + (1 - c) x^3]/Sqrt[c]] *)
The imaginary part of ad
is constant so we can subtract it off (which is the point of @JimB's comment under the OP):
ad2 = ad1 /. {{x -> 1}, {x -> x}} // Differences // First;
Assuming[0 < c < 1 && x > 0,
TrigToExp@ad2 /. {Log[z_] /; Simplify[z < 0] :> Log[-1] + Log[-z]} //
Expand // FullSimplify
]
(*
2/3 (-1 + Sqrt[c + x^3 - c x^3] +
Sqrt[c] ArcTanh[(Sqrt[c] (x^3 - Sqrt[c + x^3 - c x^3]))/(c + x^3)])
*)
Applying the identity,
$$tanh ^{-1}left(frac{1}{z}right) - tanh ^{-1}(z)=frac{i pi}{2} ,,$$
changes ad1
by a constant, which results in another antiderivative:
ad3 = ad1 /. ArcTanh[z_] :> ArcTanh[1/z]
(* 2/3 Sqrt[c + x^3 - c x^3] - 2/3 Sqrt[c] ArcTanh[Sqrt[c]/Sqrt[c + (1 - c) x^3]] *)
Rewrite ad3
in terms of logarithms:
ad4 = TrigToExp@ad3 /.
a__ Log[u_] + b__ Log[v_] + w__ /; Times@a == -Times@b :> a Log@Simplify[u/v] + w
(*
2/3 Sqrt[c + x^3 - c x^3] +
1/3 Sqrt[c] Log[(-Sqrt[c] + Sqrt[c + x^3 - c x^3]) /
(Sqrt[c] + Sqrt[c + x^3 - c x^3])]
*)
Check:
D[{ad1, ad2, ad3, ad4}, x] // Simplify
(*
{Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x,
Sqrt[c + x^3 - c x^3]/x, Sqrt[c + x^3 - c x^3]/x}
*)
Addendum:
Here is a fifth, the real part of ad1
:
ad5 = ComplexExpand[Re[ad1], TargetFunctions -> {Re, Im}] //
Simplify[#, 0 < c < 1 && x > (c/(1 - c))^(1/3)] &
(*
1/6 (4 Sqrt[c + x^3 - c x^3] +
Sqrt[c] Log[(x^3 - c (-2 + x^3) - 2 Sqrt[c (c + x^3 - c x^3)])/c] -
Sqrt[c] Log[(x^3 - c (-2 + x^3) + 2 Sqrt[c (c + x^3 - c x^3)])/c])
*)
Addendum 2:
Doing a line integral within the domain of interest will often give the desired result; however, this time it ran forever, until I turned off GenerateConditions
. The antiderivative comes back in terms of HypergeometricPFQ
which can be simplified with the aid of FunctionExpand
.
Assuming[0 < c < 1 && x > 0 && t > 0,
ad6 = Simplify@ FunctionExpand@
Integrate[Sqrt[c + (1 - c) t^3]/t, {t, 1, x},
Assumptions -> 0 < c < 1 && x > 0, GenerateConditions -> False]
]
(*
1/3 (-2 + 2 Sqrt[c + x^3 - c x^3] + 2 Sqrt[c] Log[1 + 1/Sqrt[c]] +
3 Sqrt[c] Log[x] - 2 Sqrt[c] Log[1 + Sqrt[1 + (-1 + 1/c) x^3]])
*)
(* Check *)
Simplify[D[ad6, x] - Sqrt[c + x^3 - c x^3]/x, 0 < c < 1 && x > 0]
edited 17 mins ago
answered 4 hours ago
Michael E2Michael E2
146k11197467
146k11197467
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%2f189413%2fmathematica-gives-an-unexpected-answer-for-integrate%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
When evaluating a definite integral don't the imaginary parts cancel out?
– JimB
6 hours ago
@JimB, I need the general solution on the indefinite integration, since I don't know the limits of the variable $x$ (except that $x > 0$). It's the solution of some differential equation.
– Cham
6 hours ago
You should change the subject line of the question from "wrong" to perhaps "unexpected" since
Assuming[{0<C<1, x>=0}, Sqrt[C+(1-C) x^3]/x == D[Integrate[Sqrt[C+(1-C) x^3]/x, x], x] // Simplify]
evaluates toTrue
– Bob Hanlon
2 hours ago
Tha antiderivative shown is fine. Can check by differentiation:
In[646]:= i0 = Sqrt[C + (1 - C) x^3]/x; i1 = Integrate[i0, x]; Simplify[D[i1, x] - i0] Out[648]= 0
– Daniel Lichtblau
47 mins ago