4
$\begingroup$

Here is a difficult definite integral that Mathematica cannot seem to solve symbolically:

$$\int\limits_{-1}^1 \frac{1}{x} \sqrt{\frac{1+x}{1-x}} \ln \left( \frac{x^4 + \sqrt{2} x^3 + x^2 + \sqrt{2} x +1}{x^4 - \sqrt{2} x^3 + x^2 - \sqrt{2} x +1} \right)~\mathrm dx$$

It has a solution (by hand).

Any suggestions?

Integrate[(Sqrt[(1 + x)/(1 - x)]
   Log[(1 + Sqrt[2] x + x^2 + Sqrt[2] x^3 + x^4)/
   (1 - Sqrt[2] x + x^2 - Sqrt[2] x^3 + x^4)])/x, {x, -1, 1}]

enter image description here

$\endgroup$
2
  • 5
    $\begingroup$ Please convert your code to InputForm prior to copy and paste. $\endgroup$ Commented Aug 17 at 3:40
  • $\begingroup$ OK. Fair enough. I'm so used to expressing mathematical expressions in a "mathematical" form for easier mathematical legibility, but you're right... it doesn't copy/paste into SE well. $\endgroup$ Commented Aug 17 at 14:55

2 Answers 2

7
$\begingroup$

One way:

 A = IntegrateChangeVariables[Inactive[
 Integrate][(Sqrt[(1 + x)/(1 - x)] Log[(1 + Sqrt[2] x + x^2 + 
       Sqrt[2] x^3 + x^4)/(1 - Sqrt[2] x + x^2 - Sqrt[2] x^3 + 
       x^4)])/x, x], t, t == ((1 + x)/(1 - x))^2] // Simplify

 Integrate[A[[1]], {t, 0, Infinity}](*Can't compute*)

 B = Integrate[A[[1]], t];(*Works with indefine integral*)
 Plot[B // Re, {t, 0, Infinity}](*Two discontinuities*)

 (*This function has two discontinuities at points 1 and 17.8. 
 To calculate the define integral we must take these two discontinuities 
 into account, but in this case fortunately it is enough to calculate 
 the limit only at point t=0.*)

 F = Limit[-B, t -> 0] // FullSimplify(* A a few minutes computation*)

 (* -2 \[Pi] (-\[Pi] + ArcTan[Sqrt[2 (7 + 5 Sqrt[2] + 4 Sqrt[3] + 3 Sqrt[6])]])*)

$$\int_{-1}^1 \frac{\sqrt{\frac{1+x}{1-x}} \log \left(\frac{1+\sqrt{2} x+x^2+\sqrt{2} x^3+x^4}{1-\sqrt{2} x+x^2-\sqrt{2} x^3+x^4}\right)}{x} \, dx=2 \pi ^2-2 \pi \tan ^{-1}\left(\sqrt{2 \left(7+5 \sqrt{2}+4 \sqrt{3}+3 \sqrt{6}\right)}\right)$$

$\endgroup$
4
  • $\begingroup$ Good enough. Thanks. ($\checkmark$) $\endgroup$ Commented Aug 17 at 14:56
  • $\begingroup$ @MariuszIwaniuk Nice answer! Why is it allowed to neglect the two discontinuities? $\endgroup$ Commented Aug 21 at 8:51
  • $\begingroup$ @UlrichNeumann. Good question, but I don't know the answer. $\endgroup$ Commented Aug 21 at 9:42
  • $\begingroup$ @MariuszIwaniuk What a pity, thanks. $\endgroup$ Commented Aug 21 at 9:48
8
$\begingroup$

Another way via symmetrizing & trig. sub.:

ans = Integrate[
  PowerExpand[(Sqrt[(1 + x)/(1 - x)] Log[(1 + Sqrt[2] x + x^2 + 
              Sqrt[2] x^3 + x^4)/(1 - Sqrt[2] x + x^2 - Sqrt[2] x^3 + 
              x^4)])/x] Cos[t] /. {{x -> Sin[t]}, {x -> -Sin[t]}} // 
    Total // Simplify[#, 0 < t < Pi/2] &, {t, 0, Pi/2}]
(* long answer that does not simplify as much as @Mariusz's, but... *)

N[ans, 80]
(*
10.6992098205363046897171812898466399085060169526986603351992020573877893190086823 + 0.*10^-80 I
*)

(* @Mariusz's result *)
N[-2 π (-π + ArcTan[Sqrt[2 (7 + 5 Sqrt[2] + 4 Sqrt[3] + 3 Sqrt[6])]]), 80]
(*
10.699209820536304689717181289846639908506016952698660335199202057387789319008682
*)

*Re PowerExpand[]: I checked that the numerators and denominators in the Sqrt[] and Log[] factors are positive.

**@Mariusz's simplified result seems the simplest form possible. Note also that his rationalizing substitution t == ((1 + x)/(1 - x))^2 is a standard type taught in calculus. (Cynical side comment: Since understanding how integration works was replaced by the goal of merely getting answers a several decades ago, that goal has been replaced by the goal of successfully operating software such as we use here. It is unclear how far back in the past the past tense in "standard one taught in calculus" refers. I didn't recall being taught it when I encountered it in the textbook I used when I first taught calculus ca. 1990.)

$\endgroup$
8
  • $\begingroup$ Can you recommend a source (any medium) that promotes 'understanding how integration works'? Thanks. $\endgroup$ Commented Aug 20 at 13:39
  • $\begingroup$ @Rabbit I'm talking about the de-emphasis on algebraic antidifferentiation: Computers can get the answer, so that people need not master mere techniques. I felt as a student, and I feel as a teacher, that there's interesting mathematics in the techniques. Textbooks that originated before the 1980s often still teach the basic ones (Stewart, e.g.). The rest is learning to think with them. I see it all the time on this site when users help Mathematica solve integrals it can't do without help. Paul Nahin (an engineer who loves integrals), Inside Interesting Integrals, goes beyond calc II. $\endgroup$ Commented Aug 20 at 20:08
  • $\begingroup$ There are other aspects to "understanding how integration works" that are important. I just wanted to clarify what I was talking about, in case you're interested in something else. $\endgroup$ Commented Aug 20 at 20:09
  • $\begingroup$ I teach a course at Stanford, SymSys 294 Computational Symbolic Mathematics in which the first half is how to use computer algebra and the second half is how it works. I use books by Wolfram Koepf, Joel S. Cohen, and Edmund A. Lamagna (easily found), and my own notes which I'm putting into a book. $\endgroup$ Commented Aug 21 at 1:52
  • 1
    $\begingroup$ @UlrichNeumann Symbolic integration seems to still be an area of active development. Integrate[] and DSolve[] change their abilities with each version. "New in V13" advertised improvements to Integrate[] and DSolve[]. Maybe it happened then. But there are little improvements with every version, I would guess. I don't know what specifically happened in this case, though. $\endgroup$ Commented Aug 22 at 14:00

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.