1
$\begingroup$

In ODE solutions Mathemathica uses Erf and DawsonF functions instead of the integral expressions they represent. How can I force Mathematica to show the integrals in its output? For example,

ClearAll[A];
A[x] /. DSolve[A'[x] == E^-x^2, A[x], x] /. C[1] -> 0
{1/2 Sqrt[π] Erf[x]}

But I would like to see the integral for Erf.

$\endgroup$
4
  • $\begingroup$ Can you provide a minimum working example ? $\endgroup$
    – Sektor
    Commented Oct 30, 2013 at 10:04
  • $\begingroup$ Integrate[E^(-t^2), {t, 0, x}] $\endgroup$ Commented Oct 30, 2013 at 10:15
  • $\begingroup$ Blocking Erf and DawsonF would not work. Perhaps using InheritedBlock to locally modify Integrate's rules that have to do with the definition of those special functions could help? Look at the second part of this answer: mathematica.stackexchange.com/questions/34589/… $\endgroup$
    – Peltio
    Commented Oct 30, 2013 at 12:54
  • $\begingroup$ I don't understand this question. Is the goal to typeset the integral? If so then you should use a typesetting language like latex: you can be guaranteed latex will never turn $\int_0^x e^{-t^2} dt$ into Erf[ ]. $\endgroup$
    – bill s
    Commented Nov 3, 2013 at 16:16

1 Answer 1

3
$\begingroup$

If you just want to display Erf as the integral you can use exact replacement rule

A[x] /. DSolve[A'[x] == E^-x^2, A[x], x] /. C[1] -> 0 /. 
  Erf[x_] :> 2/Sqrt[π] HoldForm[Integrate[E^-t^2, {t, 0, x}]]

enter image description here

$\endgroup$

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.