2
$\begingroup$

How can I enter a LaTeX integral into Mathematica? For example, I evaluated the expression

ToExpression["\int 2*x\[DifferentialD]x ", TeXForm]

but Mathematica told me that this is wrong.

$\endgroup$
8
$\begingroup$

Looking at

TeXForm[Integrate[f[x], x]]

We see that integrals can be entered like:

ToExpression["\int f(x) \, dx", TeXForm]
(* \[Integral]f[x]\[DifferentialD]x *)
$\endgroup$
1
  • 5
    $\begingroup$ This can be done a little more directly with TeXForm @ HoldForm @ Integrate[2 x, x], which gives \int 2 x \, dx $\endgroup$
    – m_goldberg
    Oct 11 '13 at 0:04

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.