2
$\begingroup$

This integration is not giving an answer. can anyone please help?

Integrate[-((0.5 Sqrt[(-0.008 + 0.08 r^2 - 3. r^3 + r^4)/
      r^4] (-0.0000853333 + 0.00128 r^2 - 0.024 r^3 - 0.0170667 r^4 + 
        0.36 r^5 - 6. r^6 + 
        r^7) (0.00188562 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] - 
        0.0282843 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^2 + 
        1.41421 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^3 - 
        0.707107 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^4 + 
        1. r^5 Sqrt[(0.00533333 - 0.04 r^2 + r^3)/r^6] Sqrt[(
         0.00533333 - 0.04 r^2 + r^3)/r^4]
          Sqrt[(-0.008 + 0.08 r^2 - 3. r^3 + r^4)/r^4]))/(Sqrt[(
      0.00533333 - 0.04 r^2 + r^3)/
      r^4] (-0.008 + 0.08 r^2 - 3. r^3 + r^4)^3)), {r, 5.93999, mu}, 
 Assumptions -> {mu > 5.94, r > 0}, GenerateConditions -> False]
$\endgroup$
3
  • 3
    $\begingroup$ Why not use NIntegrate? int[mu_] := NIntegrate[expr, {r, 5.93999, mu}]; Plot[int[mu], {mu, 5.9399, 8}] $\endgroup$
    – cvgmt
    Commented Aug 25, 2022 at 7:20
  • $\begingroup$ @cvgmt , with NIntegrate it is showing this , NIntegrate::nlim: r = mu is not a valid limit of integration. $\endgroup$
    – AAA
    Commented Aug 25, 2022 at 7:49
  • $\begingroup$ As suggested by @cvgmt, int[mu_?NumericQ] := NIntegrate[expr, {r, 5.93999, mu}]; Plot[int[mu], {mu, 5.9399, 8}] produces the result that I presume you wish. $\endgroup$
    – bbgodfrey
    Commented Aug 25, 2022 at 21:29

2 Answers 2

2
$\begingroup$

Since you have already numerical values in your expression, you are probably best serve using numerical integration. I'm not sure for what you need the Integration, but for instance you can plot the values using NIntegrate. Here for example a plot until mu=10:

Plot[
 NIntegrate[-((0.5 Sqrt[(-0.008 + 0.08 r^2 - 3. r^3 + r^4)/
         r^4] (-0.0000853333 + 0.00128 r^2 - 0.024 r^3 - 
         0.0170667 r^4 + 0.36 r^5 - 6. r^6 + 
         r^7) (0.00188562 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] - 
         0.0282843 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^2 + 
         1.41421 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^3 - 
         0.707107 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^4 + 
         1. r^5 Sqrt[(0.00533333 - 0.04 r^2 + r^3)/
            r^6] Sqrt[(0.00533333 - 0.04 r^2 + r^3)/
            r^4] Sqrt[(-0.008 + 0.08 r^2 - 3. r^3 + r^4)/
            r^4]))/(Sqrt[(0.00533333 - 0.04 r^2 + r^3)/
         r^4] (-0.008 + 0.08 r^2 - 3. r^3 + r^4)^3)), {r, 5.94, mu}],
 {mu, 5.94, 10}
 ]

Plot of expression for mu=[5.94,10]

$\endgroup$
2
  • $\begingroup$ Actually, I need the expression in terms of mu as further, I have to integrate with respect to mu after putting this result in some expression. $\endgroup$
    – AAA
    Commented Aug 25, 2022 at 8:03
  • $\begingroup$ Could you post the whole problem, so we can figure out a way around that? With such complicated expressions an analytic workflow is probably not possible, so a numerical approximation of your whole project will be necessary. $\endgroup$
    – azt
    Commented Aug 25, 2022 at 8:53
2
$\begingroup$
Clear["Global`*"];
f[r_] = -((0.5 Sqrt[(-0.008 + 0.08 r^2 - 3. r^3 + r^4)/
         r^4] (-0.0000853333 + 0.00128 r^2 - 0.024 r^3 - 
         0.0170667 r^4 + 0.36 r^5 - 6. r^6 + 
         r^7) (0.00188562 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] - 
         0.0282843 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^2 + 
         1.41421 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^3 - 
         0.707107 Sqrt[2 - 0.016/r^4 + 0.16/r^2 - 6/r] r^4 + 
         1. r^5 Sqrt[(0.00533333 - 0.04 r^2 + r^3)/
            r^6] Sqrt[(0.00533333 - 0.04 r^2 + r^3)/
            r^4] Sqrt[(-0.008 + 0.08 r^2 - 3. r^3 + r^4)/
            r^4]))/(Sqrt[(0.00533333 - 0.04 r^2 + r^3)/
         r^4] (-0.008 + 0.08 r^2 - 3. r^3 + r^4)^3));
int[mu_?NumericQ] := NIntegrate[f[r], {r, 5.93999, mu}]
Plot[int[mu], {mu, 5.93999, 8}, AxesOrigin -> {0, 0}]

enter image description here

Or

Clear[F];
F = NDSolveValue[{y'[mu] == f[mu], y[5.93999] == 0},    y, {mu, 5.93999, 8}]; 
Plot[F[mu], {mu, 5.93999, 8}, AxesOrigin -> {0, 0}]
$\endgroup$
8
  • $\begingroup$ Or use Clear[F]; F = NDSolveValue[{y'[mu] == f[mu], y[5.93999] == 0}, y, {mu, 5.93999, 8}]; Plot[F[mu], {mu, 5.93999, 8}, AxesOrigin -> {0, 0}] $\endgroup$
    – cvgmt
    Commented Aug 25, 2022 at 8:00
  • $\begingroup$ Actually, I need the expression in terms of mu as further, I have to integrate with respect to mu after putting this result in some expression. $\endgroup$
    – AAA
    Commented Aug 25, 2022 at 8:03
  • $\begingroup$ @AKU Use int[mu]. $\endgroup$
    – cvgmt
    Commented Aug 25, 2022 at 8:05
  • $\begingroup$ I am using Mathematica 13 , and using the same way you did, I am getting this error. NIntegrate::nlim: r = mu is not a valid limit of integration. $\endgroup$
    – AAA
    Commented Aug 25, 2022 at 8:06
  • $\begingroup$ it is plotting it but not giving the expression. $\endgroup$
    – AAA
    Commented Aug 25, 2022 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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