-1
$\begingroup$

Could anyone give me a hint How I solve this integral by mathematica my integral is

Integrate[
   phi[x] Log[phi[x]] + (1 - phi[x]) Log[1 - phi[x]] + 
     chi phi[x] (1 - phi[x]) + (1/2) phi'[x]^2, 
   {x, 12, 20}]

with the following definitions:

chi = 62/27; 
phi[x_] := x Log[x] + (1 - x) Log[1 - x] + chi x (1 - x)

Notice the phi'[x]^2 derivatives is taken with respect to $x$.

$\endgroup$

closed as off-topic by happy fish, MarcoB, Nasser, gwr, Öskå Mar 1 '17 at 17:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – happy fish, MarcoB, Nasser, gwr, Öskå
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ how should Mathematica now what to do with it, if you dont give any information about your function phi[x]? $\endgroup$ – Mauricio Fernández Feb 27 '17 at 7:00
  • $\begingroup$ phi[x] is just a function ordinary function , what is given that phi[0] = 9.2 $\endgroup$ – dr.mo Feb 27 '17 at 7:02
  • $\begingroup$ But if you dont give any information on it, you wont get anything from Mathematica. Trivial example: Integrate[phi[x], {x, 0, 1}] wont give you anything. What are you looking for? What do you mean by "solve this integral"?n phi[0]=9.2 does not help, you need the function over the complete interval of x. Besides, you are integrating from 12 to 20. $\endgroup$ – Mauricio Fernández Feb 27 '17 at 7:04
  • $\begingroup$ this is my function phi[x]= x Log[x] + (1 - x) Log[1 - x] + chi x (1 - x) $\endgroup$ – dr.mo Feb 27 '17 at 7:21
  • 1
    $\begingroup$ Is there any reason that you are expecting a real result? $\endgroup$ – Dimitris Feb 27 '17 at 11:37
2
$\begingroup$

I don't see any any particular reason why the integral should be real.

chi = 62/27;
phi[x_] := x Log[x] + (1 - x) Log[1 - x] + chi x (1 - x)

integrand = 
  phi[x] Log[phi[x]] + (1 - phi[x]) Log[1 - phi[x]] + 
   chi phi[x] (1 - phi[x]) + (1/2) phi'[x]^2;

Plot[{Re[integrand], Im[integrand]}, {x, 12, 20}, 
PlotStyle -> {Red, Blue}]

enter image description here

Mathematica seems to be unable to evaluate abalytically the indefinite integral (at least in reasonable time). And considering its complexity this sounds normal.

Integrate[integrand, x]
(* ∫(1/
     2 ((62 (1 - x))/27 - (62 x)/27 - Log[1 - x] + Log[x])^2 + 
    62/27 (1 - 62/27 (1 - x) x - (1 - x) Log[1 - x] - 
       x Log[x]) (62/27 (1 - x) x + (1 - x) Log[1 - x] + 
       x Log[x]) + (1 - 62/27 (1 - x) x - (1 - x) Log[1 - x] - 
       x Log[x]) Log[
      1 - 62/27 (1 - x) x - (1 - x) Log[1 - x] - 
       x Log[x]] + (62/27 (1 - x) x + (1 - x) Log[1 - x] + 
       x Log[x]) Log[
      62/27 (1 - x) x + (1 - x) Log[1 - x] + 
       x Log[x]]) \[DifferentialD]x *)

(Integrate[#, x] & /@ (Expand@integrand)) // Simplify
(* -(5333/1458) - (4030 x)/2187 - (4805 x^2)/2187 - (
 151838 x^3)/59049 + (119164 x^4)/19683 - (
 238328 x^5)/98415 + ∫Log[
    1 + 62/27 (-1 + x) x + (-1 + x) Log[1 - x] - 
     x Log[x]] \[DifferentialD]x - 
 62/27 ∫x Log[
      1 + 62/27 (-1 + x) x + (-1 + x) Log[1 - x] - 
       x Log[x]] \[DifferentialD]x + 
 62/27 ∫x^2 Log[
      1 + 62/27 (-1 + x) x + (-1 + x) Log[1 - x] - 
       x Log[x]] \[DifferentialD]x - ∫Log[1 - x] Log[
     1 + 62/27 (-1 + x) x + (-1 + x) Log[1 - x] - 
      x Log[x]] \[DifferentialD]x + ∫x Log[1 - x] Log[
     1 + 62/27 (-1 + x) x + (-1 + x) Log[1 - x] - 
      x Log[x]] \[DifferentialD]x - ∫x Log[x] Log[
     1 + 62/27 (-1 + x) x + (-1 + x) Log[1 - x] - 
      x Log[x]] \[DifferentialD]x + 
 62/27 ∫x Log[-(62/27) (-1 + x) x - (-1 + x) Log[1 - x] + 
       x Log[x]] \[DifferentialD]x - 
 62/27 ∫x^2 Log[-(62/27) (-1 + x) x - (-1 + x) Log[1 - x] + 
       x Log[x]] \[DifferentialD]x + ∫Log[
     1 - x] Log[-(62/27) (-1 + x) x - (-1 + x) Log[1 - x] + 
      x Log[x]] \[DifferentialD]x - ∫x Log[
     1 - x] Log[-(62/27) (-1 + x) x - (-1 + x) Log[1 - x] + 
      x Log[x]] \[DifferentialD]x + ∫x Log[
     x] Log[-(62/27) (-1 + x) x - (-1 + x) Log[1 - x] + 
      x Log[x]] \[DifferentialD]x + (482 Log[1 - x])/2187 + 
 124/81 x Log[1 - x] - 3286/729 x^2 Log[1 - x] + (
 15376 x^3 Log[1 - x])/2187 - 1922/729 x^4 Log[1 - x] + 
 43/162 Log[1 - x]^2 - 97/54 x Log[1 - x]^2 + 
 62/27 x^2 Log[1 - x]^2 - 62/81 x^3 Log[1 - x]^2 - 
 398/243 Log[-1 + x] + 248/81 x Log[x] - 62/81 x^2 Log[x] - (
 7688 x^3 Log[x])/2187 + 1922/729 x^4 Log[x] + 
 143/81 Log[1 - x] Log[x] - x Log[1 - x] Log[x] - 
 62/27 x^2 Log[1 - x] Log[x] + 124/81 x^3 Log[1 - x] Log[x] + 
 1/2 x Log[x]^2 - 62/81 x^3 Log[x]^2 + 143/81 PolyLog[2, x] *)

May be in a book like the classic one

Irresistible Integrals: Symbolics, Analysis And Experiments In The Evaluation Of Integrals

you can find ways to evaluate the integrals that rest unevaluated in the last output.

My expirience has shown that Mathematica can do virtually all indefinite intergals that can be done analytically.

In any case,

NIntegrate[
 phi[x] Log[phi[x]] + (1 - phi[x]) Log[1 - phi[x]] + 
  chi phi[x] (1 - phi[x]) + (1/2) phi'[x]^2, {x, 12, 20}]
(* -6.20008*10^6 - 997716. I *)

which looks quite normal to me.

Some other references

http://12000.org/index.htm

Abramowitz and Stegun. Handbook of Mathematical Functions

https://www.cs.cmu.edu/~adamchik/articles/integr/mier.pdf

You can post also in the forums below

https://groups.google.com/forum/#!forum/comp.soft-sys.math.mathematica https://groups.google.com/forum/#!forum/sci.math.symbolic

I don't know if the first one is still active.

Of course wait and other replies from more experienced users or more mathematically oriented than me.

$\endgroup$
  • $\begingroup$ You are welcome:-)! $\endgroup$ – Dimitris Feb 27 '17 at 17:30

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