0
$\begingroup$

I am trying to write down the following expression

Integrate[Exp[-a/2/x]/x/(x + 1), {x, 0, b}, Assumptions -> a > 0 && b > 0]

using mathematical notation. I have tried

Assuming[b > 0 && a > 0, Subscript[\[Integral], 0]^b E^(-(a/(2 x)))/(x (x + 1)) \[DifferentialD]x]

and in picture

screenshot of mathematical notation from Mathematica

However, Mathematica returns Syntax: Incomplete expression; more input is needed.

Could you please give guidance what is wrong here? Thank you.

$\endgroup$

2 Answers 2

0
$\begingroup$

There is a syntax error with Subscript

Try

Assuming[b > 0 && a > 0, Integrate[Exp[-a/2/x]/x/(x + 1), {x, 0, b}]]
(*-E^(a/2) ExpIntegralEi[-((a (1 + b))/(2 b))]*)
$\endgroup$
3
  • $\begingroup$ Thanks for the answer! However, that is not my question. The first line works fine. I am trying to rewrite it using nice notation. I think that my first line of code Integrate[Exp[-a/2/x]/x/(x + 1), {x, 0, b}, Assumptions -> a > 0 && b > 0] and the screenshot should be equivalent and the former evaluates fine but the latter does not evaluate. The Subscript line is just a copy-paste of the screenshot from the Mathematica editor; I did not enter that. What is wrong in the screenshot? Do I write the integral incorrectly? $\endgroup$
    – drumath
    May 12, 2022 at 8:47
  • $\begingroup$ According to Mathematica's manual on Integrate, Subscript should be used to enter $x_{min}$, the lower boundary of the integral, when using "nice notation" (my terminology). $\endgroup$
    – drumath
    May 12, 2022 at 8:49
  • $\begingroup$ @drumath Might be! I tried to evaluate your code line(cut&paste) and Mathematica gives an error $\endgroup$ May 12, 2022 at 9:18
0
$\begingroup$

I found the issue. The solution was in the examples section of Integrate. The syntax error is with the superscript ^ after \[Integral] in Subscript[\[Integral], 0]^b. Ctrl+% has to be used instead of Ctrl+^.

Correctly:

Assuming[b > 0 && a > 0, \!\(\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(b\)]\(\*FractionBox[SuperscriptBox[\(E\), \(-\*FractionBox[\(a\), \(2 x\)]\)], \(x \((x + 1)\)\)] \[DifferentialD]x\)\)]

This looks long here but copying it back to the Mathematica editor results again in the nice picture posted in the question.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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