I try to post the following question on Mahtematica Stack Exchange (see below the triple lines). It shows up perfectly in the preview, but when I try to post I get the error "Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon."

I have the Mathematica code indented, so there must be a problem with the LaTeX code (but if I indent that it becomes unreadable).

Is this a bug or is there a reason for people not wanting type-set equations in the stack exchange? I would request that typesetting be allowed since you can copy your code from Mathematica as Latex and then have the raw form in the post script.

Recall that some define the Fourier transform and its inverse as:

$$ g\left(\omega\right)=\int^{\infty}{-\infty}f(t)e^{-i\omega t}dt $$ $$ f(t)=\frac{1}{2\pi}\int^{\infty}{-\infty}g(\omega)e^{i\omega t}d\omega $$

Mathematica does not define it this way, but I should be able to use the above definition (with PrincipleValue $\rightarrow$ True) and get results which are consistent with all the Fourier transform pair tables I see. For example, I see the following Fourier transform pair on multiple tables (which use the definitions I gave above) and can verify it by residue theorem:

$$ u(t) \leftrightarrow \pi\delta(\omega)+\frac{1}{i\omega} $$

Where $u(t)$ is the unit step function (if (t) is positive you have to integrate around upper half of complex plane, otherwise, lower half of complex plane ... ) and $\delta(\omega)$ is the Dirac delta-function. However:

$$\text{FullSimplify}\left[\text{ComplexExpand}\left[\frac{\text{Integrate}\left[\left(\pi \delta (\omega )+\frac{1}{i \omega }\right) e^{i \omega t },{\omega ,-\infty ,\infty },\text{PrincipalValue}\to \text{True}\right]}{2 \pi }\right]\right]$$

Returns $$\text{ConditionalExpression}\left[ \begin{array}{cc} { & \begin{array}{cc} -\frac{1}{2} & t<0 \ \frac{1}{8} & t=0 \ \frac{1}{2} & \text{True} \ \end{array} \ \end{array} ,t\in \mathbb{R}\right]$$

This is not extremely far off and there are clear workarounds, but what gets me is that there was no "complaining" from Mathematica, so my question is: Is there another method for finding principle-value integrals which Mathematica is using?

P.S. For anyone who may want to copy+paste the code, it is in "raw input form" below. Copy+paste into Mathematica then right click the cell and select convert to->Standard form (it will already have "standard form" check-marked, but click it anyway to make everything look nicer).

FullSimplify[ComplexExpand[Integrate[(Pi*DiracDelta[\[Omega]] + 1/(I*\[Omega]))*E^(I*t*\[Omega]), {\ 
[Omega], -Infinity, Infinity}, PrincipalValue -> True]/(2*Pi)]]
  • I seem to have no issues posting your exact question, so I'm not sure what's going on. But anyway, is there a reason you're not just showing the code in the normal input form, as is the case for every other question on this site? Your way might look slightly nicer, but it makes copy&paste extremely hard to impossible, so this is not really a good tradeoff.
    – Lukas Lang
    Sep 21, 2020 at 14:14
  • 1
    This is a common-ish issue check this.
    – b3m2a1
    Sep 21, 2020 at 14:14

1 Answer 1


I experimented with a couple of your MathJaX entries in our code editor. Here is as screen capture of how it looked.


I also included a couple of comments on your MathJaX. both to inform you and to give the editor a fairly normal piece of work. Here is how the 2nd entry should be been posted.

    Integrate[(π δ[ω] + 1/(I ω)) E^(I ω t), {ω, -∞, ∞}, PrincipalValue -> True] /(2 π)]]

BTW, there are two minor mistakes in the 1st MathJaX entry above. It should be:

$$g\left(\omega\right)=\int^{\infty}_{-\infty}f(t)e^{-i\omega t}dt $$
$$f(\omega)=\frac{1}{2\pi}\int^{\infty}_{-\infty}g(\omega)e^{i\omega t}d\omega $$

Your version doesn't place the -∞'s in the lower bound position of the integrals because you omitted the required underscores. Also, I think the t in f(t) should be an ω. I'm confident that you would have corrected these typos if you had seen your MathJaX rendered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .