Integrate this equation using the Wolfram Language?

Hi,
I have problem to integrate this equation w.r.t. x.

Integrate[x^3/Sqrt[(1 - x) (1 - x a^2 Cos[\[Alpha]]) - 
  3 a x Log[x]], {x, 0, 1}]

Can anyone help me with this problem? Thanks in advance!

This is just too complicated to integrate in closed form. Numerical integration will work.

Numeric solution.

ClearAll["Global`*"]
f[a_?NumericQ, \[Alpha]_?NumericQ] := NIntegrate[x^3/Sqrt[(1 - x)*(1 - x*a^2*Cos[\[Alpha]]) - 3*a*x*Log[x]], {x, 0, 1}]

for a=1 and alfa=Pi

a = 1;
\[Alpha] = Pi;
f[a, \[Alpha]]
(*0.422834*)

  Plot[Evaluate@Table[f[a, \[Alpha]], {\[Alpha], 0, Pi, Pi/4}], {a, 0, 5}, PlotLegends -> {"\[Alpha]=0", "\[Alpha]=Pi/4", "\[Alpha]=Pi/2", 
    "\[Alpha]=3Pi/4", "\[Alpha]=Pi"}, AxesLabel -> {a, f[a, \[Alpha]]}]
  Plot[Evaluate@Table[f[a, \[Alpha]], {a, 0, 3, 1/2}], {\[Alpha], 0, Pi}, PlotLegends -> {"a=0", "a=1/2", "a=1", "a=3/2", "a=2", "a=5/2",
     "a=3"}, AxesLabel -> {\[Alpha], f[a, \[Alpha]]}]

Plot3D[f[a, \[Alpha]], {a, 0, 3}, {\[Alpha], 0, Pi},  AxesLabel -> Automatic, PlotLegends -> {"Integral"}]

ParametricPlot3D[Evaluate[Table[{a, \[Alpha], f[a, \[Alpha]]}, {\[Alpha], 0, 3, 0.25}]], {a, 0, 3}, BoxRatios -> {1, 1, 1}, AxesLabel -> {"a", "\[Alpha]", "f[a,\[Alpha]]"}]

Thank you for your comment :smiley:

Thank you very much! I really appreciate your help!

Is it possible to get answer in term of a?

Ok.Maybe like this:

ClearAll["Global`*"]
\[Alpha] = Pi/4;
f[a_?NumericQ] :=  NIntegrate[x^3/Sqrt[(1 - x)*(1 - x*a^2*Cos[\[Alpha]]) - 3*a*x*Log[x]], {x, 0, 1}]
Plot[f[a], {a, 0, 5}, PlotLegends -> {"\[Alpha]=Pi/4"}, AxesLabel -> {a, f[a]}]

Hi, sorry for the hiatus.

What if I want to know the value of “a” if I prescribed the value of C?

ClearAll[“Global*"] Remove["Global*”]

 f[a_?NumericQ] := NIntegrate[x^3/Sqrt[(1 - x)*(1 - x*a^2*Cos[\[Alpha]]) - 3*a*x*Log[x]], {x, 0, 1}]
 
 c = 0.7;
 \[Alpha] = Pi/4;

 sol1 = FindRoot[c == f[a], {a, 1/2}]
 (* {a -> 0.267439} *)

 sol2 = FindRoot[c == f[a], {a, 4}]
 (* {a -> 4.15722} *)

 Plot[{f[a], c}, {a, 0, 5}, PlotLegends -> {"\[Alpha]=Pi/4", "c"}, Epilog -> {Red, AbsolutePointSize[6], Point[{{a /. sol1, c}, {a /. sol2, c}}]}, 
 Prolog -> {Green, Line[{{a /. sol1, 0.4}, {a /. sol1, c + 0.1}}], Line[{{a /. sol2, 0.4}, {a /. sol2, c + 0.1}}]}, AxesLabel -> {a, f[a]}]

Wow! You are amazing! I have learned a lot from you! Thank you very much!

You’re welcome. :slight_smile:

Hi Nurul,

sorry for this late response. If you are interested in accurate numerical results then the method shown by @Mariusz Iwaniuk
will work perfect. One other option is an approximation which might be less accurate but gives an analytical expression. Here is a very simple approach:

One can sample the integrand function along the finite interval of integration; the sampling values still contain the undefined parameters! From these values one can create the InterpolatingPolynomial - which of course can be integrated analytically!
Here is my tiny bit of code:

ClearAll["Global`*"]
(* the integrand: *)    
f[x_] := x^3/Sqrt[(1 - x) (1 - x a^2 Cos[\[Alpha]]) - 3 a x Log[x]]
(* sampling the interval between 0 and 1: *)    
samples = Simplify@Table[{x, f[x]}, {x, 0.01, .99, .08}];
ipp = InterpolatingPolynomial[samples, x];

Now the integration can be done analytically:

As you can see you end up with an analytical expression depending on the parameters only. If this approximation is not good enough, then just use more terms/samples.

Isn’t Mathematica just great?!? Regards – Henrik

Hi Henrik!

Thank you very much for your response and sharing your code! Mathematica is great and so are you :slight_smile: