# How to integrate this product of Exp[] and Cos[] using Mathematica

I would like to integrate the following product of Exp and Cos

Integrate[Exp[-a x^2 + b x] Cos[x t], {x, -Infinity, Infinity}]


But the output is the same as the input form. Is it possible for Mathematica to perform this integration?

• Integrate[Exp[-a x^2 + b x] Cos[x t], {x, -Infinity, Infinity}, Assumptions -> t > 0 && a > 0 && b > 0] May 14 at 15:02
• Obviously a has to be greater zero, t needs to be real, and there are no restrictions on b. May 14 at 16:03
• Less restrictive assumptions, faster too: res = Integrate[Exp[-a x^2 + b x] Cos[x t] // TrigToExp, {x, -Infinity, Infinity}, Assumptions -> a > 0]. And res // ExpToTrig // TrigExpand // Simplify gives a nice looking result. May 14 at 16:58
• If you wait, this gives a result with a condition for integrability: Integrate[ Exp[-a x^2 + b x] Cos[x t] // TrigToExp, {x, -Infinity, Infinity}] May 14 at 17:12
• Thanks a lot for your help! May 16 at 10:56

## 1 Answer

Besides of the method provide by @Michael E2,we can test the result by N-L formula.

int = Integrate[Exp[-a x^2 + b x] Cos[x t], x, Assumptions -> a > 0]
expr = Limit[int, x -> ∞, Assumptions -> a > 0] -
Limit[int, x -> -∞, Assumptions -> a > 0]
Simplify[expr // ComplexExpand, a > 0]


The same as

Assuming[a > 0,
Integrate[
Exp[-a x^2 + b x] Cos[x t] // TrigToExp, {x, -∞,∞}] // ComplexExpand // Simplify]

• Why this code does not work well? Integrate[Exp[-a x^2 + b x] Cos[x t], {x, -Infinity, Infinity}, Assumptions -> a > 0] // ComplexExpand // Simplify May 16 at 11:03