# How can I evaluate a certain integral? [closed]

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$.

## 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.

• how should Mathematica now what to do with it, if you dont give any information about your function phi[x]? – Mauricio Fernández Feb 27 '17 at 7:00
• phi[x] is just a function ordinary function , what is given that phi = 9.2 – dr.mo Feb 27 '17 at 7:02
• 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=9.2 does not help, you need the function over the complete interval of x. Besides, you are integrating from 12 to 20. – Mauricio Fernández Feb 27 '17 at 7:04
• this is my function phi[x]= x Log[x] + (1 - x) Log[1 - x] + chi x (1 - x) – dr.mo Feb 27 '17 at 7:21
• Is there any reason that you are expecting a real result? – Dimitris Feb 27 '17 at 11:37

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}] 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

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