2
$\begingroup$

How can I keep the argument of TeXForm[Integrate[1/Sqrt[1 + x], x]] from being evaluated?

This is what I am getting:

TeXForm[Integrate[1/Sqrt[1 + x], x]]
2 \sqrt{x+1}

But I want:

\int_{0}^{\pi/2} 1/\sqrt{x+1}
$\endgroup$
  • 1
    $\begingroup$ how about TeXForm[HoldForm@Integrate[1/Sqrt[1 + x], x]]? $\endgroup$ – kglr Aug 28 at 21:09
  • $\begingroup$ @kglr Works, thanks! $\endgroup$ – Martin Inf1n1ty Aug 28 at 21:10
  • $\begingroup$ I suggest TeXForm[Defer @ Integrate[1/Sqrt[1 + x], {x, 0, \[Pi]}]] to get the exact output form you say you want. $\endgroup$ – m_goldberg Aug 28 at 22:23
3
$\begingroup$

Try HoldForm or Defer or Unevaluated:

TeXForm[HoldForm @ Integrate[1/Sqrt[1 + x], x]]

\int \frac{1}{\sqrt{1+x}} \, dx

TeXForm[Defer @ Integrate[1/Sqrt[1 + x], x]]

\int \frac{1}{\sqrt{1+x}} \, dx

TeXForm[Unevaluated @ Integrate[1/Sqrt[1 + x], x]]

\int \frac{1}{\sqrt{1+x}} \, dx

$\int \frac{1}{\sqrt{1+x}} \, dx$

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