This can be computed “by hand” using (one of) the textbook definition(s) :
sage: var("omega, s")
(omega, s)
sage: integrate(sin(x^2)*e^(-I*s*x), x, -oo, oo)
1/2*sqrt(2)*sqrt(pi)*cos(1/4*s^2) - 1/2*sqrt(2)*sqrt(pi)*sin(1/4*s^2)
Both sympy and giac have implementations of this transform :
sage: from sympy import fourier_transform, sympify
sage: fourier_transform(*map(sympify, (sin(x^2),x, s)))._sage_()
1/2*sqrt(2)*sqrt(pi)*(cos(pi^2*s^2) - sin(pi^2*s^2))
sage: libgiac.fourier(*map(lambda u:u._giac_(), (sin(x^2), x, s))).sage()
1/2*sqrt(2)*sqrt(pi)*(cos(1/4*s^2) - sin(1/4*s^2))
which do not follow the same definitions… But beware : they may be more or less wrong :
sage: integrate(sin(x)*e^(-I*s*x), x, -oo, oo).factor()
undef # Wrong
sage: fourier_transform(*map(sympify, (sin(x),x, s)))._sage_()
0 # Wrong AND misleading
sage: libgiac.fourier(*map(lambda u:u._giac_(), (sin(x), x, s))).sage()
I*pi*dirac_delta(s + 1) - I*pi*dirac_delta(s - 1) # Better...
BTW:
sage: mathematica.FourierTransform(sin(x^2), x, s).sage().factor()
1/2*cos(1/4*s^2) - 1/2*sin(1/4*s^2)
sage: mathematica.FourierTransform(sin(x), x, s).sage().factor()
-1/2*I*sqrt(2)*sqrt(pi)*(dirac_delta(s + 1) - dirac_delta(s - 1))
HTH,
This can be computed “by hand” using (one of) the textbook definition(s) :
sage: var("omega, s") (omega, s) sage: integrate(sin(x^2)*e^(-I*s*x), x, -oo, oo) 1/2*sqrt(2)*sqrt(pi)*cos(1/4*s^2) - 1/2*sqrt(2)*sqrt(pi)*sin(1/4*s^2)Both
sympyandgiachave implementations of this transform :sage: from sympy import fourier_transform, sympify sage: fourier_transform(*map(sympify, (sin(x^2),x, s)))._sage_() 1/2*sqrt(2)*sqrt(pi)*(cos(pi^2*s^2) - sin(pi^2*s^2)) sage: libgiac.fourier(*map(lambda u:u._giac_(), (sin(x^2), x, s))).sage() 1/2*sqrt(2)*sqrt(pi)*(cos(1/4*s^2) - sin(1/4*s^2))which do not follow the same definitions… But beware : they may be more or less wrong :
sage: integrate(sin(x)*e^(-I*s*x), x, -oo, oo).factor() undef # Wrong sage: fourier_transform(*map(sympify, (sin(x),x, s)))._sage_() 0 # Wrong AND misleading sage: libgiac.fourier(*map(lambda u:u._giac_(), (sin(x), x, s))).sage() I*pi*dirac_delta(s + 1) - I*pi*dirac_delta(s - 1) # Better...BTW:
sage: mathematica.FourierTransform(sin(x^2), x, s).sage().factor() 1/2*cos(1/4*s^2) - 1/2*sin(1/4*s^2) sage: mathematica.FourierTransform(sin(x), x, s).sage().factor() -1/2*I*sqrt(2)*sqrt(pi)*(dirac_delta(s + 1) - dirac_delta(s - 1))
This also depends on Trac#31756 , not in 9.3 but in 9.4.beta0 : up to 9.3, mathematica("Sqrt[x]").sage() would give you Sqrt(x) (and not sqrt(x) as expected)…
Yep, with a bit of cut’n paste (since both foms can’t be obtained from the same Mathematica installation) :
sage: var("x, s")
(x, s)
sage: a="-I*(dirac_delta(s + 1) - dirac_delta(s - 1))*sqrt(1/2*pi)" # text representatin of yours.
sage: b="-1/2*I*sqrt(2)*sqrt(pi)*(dirac_delta(s + 1) - dirac_delta(s - 1))" # text representation of mine.
sage: bool(eval(a)==eval(b))
True