2
$\begingroup$

I'm collecting problems for which the basic or direct approach in Mathematica (v. 13 or later) does not work, but requires some trick or mathematical insight. I'd like to start with integration.

For instance,

int = Integrate[
Sqrt[Log[9-x]]/(Sqrt[Log[9-x]]+ Sqrt[Log[3+x]]), 
{x,2,4}]

does not evaluate, but

IntegrateChangeVariables[int, y, y == x - 3];

Activate[%]

gives the correct answer. Again, mere "direct button pushing" does not work; the user must see and exploit mathematical knowledge.

I want my students to learn these special tricks and insights, and the more examples I have the better.

I think examples here would be of great use to our community (and to WRI as it refines its symbolic algorithms).

$\endgroup$
3
  • $\begingroup$ Not sure I understand the difference with the previous post mathematica.stackexchange.com/questions/245399/… $\endgroup$ Commented Nov 20, 2022 at 6:11
  • $\begingroup$ Entirely different. No relation whatsoever. The previous posting is about integrals that cannot be solved directly, and the length of solution is irrelevant. The posting here is about integrals that CAN be solved directly and the length of the solution is essential. What do you see as the similarity between the questions? Please explain. $\endgroup$ Commented Nov 20, 2022 at 6:20
  • $\begingroup$ The comment above is not on your post about the length of integrals. The link I gave is for a question you asked in 2021 which was more general but included this question. I mainly left the link as a reference to a related post. I have a vague memory of another post that listed some methods but I can not find it $\endgroup$ Commented Nov 20, 2022 at 7:37

1 Answer 1

4
$\begingroup$
$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global`*"]

The following integral returns unevaluated

Assuming[x > 0, Integrate[1 - (1 - Exp[-t/x])^x, {t, 0, ∞}]]

enter image description here

Evaluating for specific integer values of x

seq = Integrate[1 - (1 - Exp[-t/#])^#, {t, 0, ∞}] & /@ Range[7]

(* {1, 3, 11/2, 25/3, 137/12, 147/10, 363/20} *)

Use FindSequenceFunction to generalize from the sequence -- to include for non-integer values of x

int[x_] = FindSequenceFunction[seq, x] // FullSimplify

(* x HarmonicNumber[x] *)

Verifying the result by comparing with numerical integration

intN[x_?NumericQ] := NIntegrate[1 - (1 - Exp[-t/x])^x, {t, 0, ∞}]

Plot[{int[x], intN[x]}, {x, 0, 1000},
 PlotStyle -> {Automatic, Dashed},
 PlotLegends -> Placed[{"Exact", "Numeric"}, {.75, .3}],
 AxesLabel -> (Style[#, 14] & /@ {x, int})]

enter image description here

$\endgroup$
7
  • $\begingroup$ I was not aware of the following bug: Integrate[1 - (1 - Exp[-t/x])^x /. x -> 1.5, {t, 0, \[Infinity]}] has a do not converge error but using x/.->3/2 Mathematica finds an exact result. $\endgroup$ Commented Nov 20, 2022 at 7:45
  • $\begingroup$ @userrandrand - even worse, Integrate[1 - (1 - Exp[-t/x])^x /. x -> 1.5, {t, 0, \[Infinity]}, GenerateConditions -> True] evaluates to an imaginary number. $\endgroup$
    – Bob Hanlon
    Commented Nov 20, 2022 at 16:57
  • $\begingroup$ I checked wolfram alpha here and the imaginary number is probably $3 \pi /2 $ or a more complicated number related to zeta. $\endgroup$ Commented Nov 20, 2022 at 20:00
  • $\begingroup$ With x->2.4 and GenerateConditions -> True it outputs a complex number where the imaginary part has practically all of the digits of $ 2.4\pi$. Not sure what mathematica is doing with the real part. $\endgroup$ Commented Nov 20, 2022 at 20:17
  • $\begingroup$ Sorry maybe last comment. With AsymptoticIntegrate[1 - (1 - Exp[-t/x])^x /. x -> 3/2, {t, 0, y}, y -> Infinity] a $3\pi/2$ also appears. Also, changing the lower boundary from 0 to 1 with ` /. x ->3/2` the $i3\pi/2$ appears but it is canceled exactly by an $\arcsin$ term. Maybe the source of the error is somewhere around there. $\endgroup$ Commented Nov 20, 2022 at 21:02

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.