3

I would like to plot a graph of this function:

enter image description here

Alternatively it could be expressed like this:

enter image description here

Either way, it's a symbolic expression, and as far as I'm aware, LaTeX can't solve it for me. Wolframalpha can't solve this either. Unfortunately, I don't have access to Mathematica to plot it.

Failing an exact plot of the function, I tried to simply capture its behaviour, as I know it should look similar to

enter image description here

The numbers on the axis and graph aren't important, I would simply like to be able to draw a graph like in the image. I can't think of a function that captures a similar behaviour however. Is there a way to literally draw a curve in LaTeX?

  • Welcome to TeX.SE. Have you tried Matlab? It can solve numerically this type of equations. – Diaa Oct 10 at 23:55
  • Unfortunately I don't have that either, and I've already used the free trial. I suppose I can try to find someone with it, especially if it can solve the integral itself. – SBrents Oct 11 at 0:27
4

Welcome! I am sure you can tweak the parameters to find an even better fit, but to very first approximation this is just a linear combination of two Gaussians of opposite signs, different amplitudes and widths (plus a shift by pi/2). You can play with the widths and prefactors to get a better fit.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots} 
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}
 \addplot[domain=-10:10,samples=101,smooth] {pi/2+exp(-0.2*x*x)-(pi/2+1)*exp(-x*x)};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

  • It's perfect, thanks! I'd give it a vote if I could. – SBrents Oct 11 at 0:46

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.