This question already has an answer here:

I want to use the command FourierTransform to transform a differential equations from time - domain to complex frequency domain but it don't works. My code is

    eq = {a'[t] == -κ/2 a[t] - I g b[t] E^(I Ω t) + 
    Sqrt[κ] ain , 
  b'[t] == -Γ/2 b[t] - I Ω b[t] - 
    I g a[t] E^(- I Ω t) + Sqrt[Γ] bin}
ff = FourierTransform[eq, t, ω]

The Result is

   (* {FourierTransform[
  Derivative[1][a][t] == 
   ain Sqrt[κ] - 1/2 κ a[t] - 
    I E^(I t Ω) g b[t], t, ω], 
  Derivative[1][b][t] == 
   bin Sqrt[Γ] - I E^(-I t Ω) g a[t] - 
    1/2 Γ b[t] - I Ω b[t], t, ω]} *)

Then I try use Map to make it works

eq = {a'[t] == -κ/2 a[t] - I g b[t] E^(I Ω t) + 
    Sqrt[κ] ain , 
  b'[t] == -Γ/2 b[t] - I Ω b[t] - 
    I g a[t] E^(- I Ω t) + Sqrt[Γ] bin}
ff = FourierTransform[#, t, ω] &
Map[ff, eq, {2}]

But it doesn't work, either:

(*{-I ω FourierTransform[a[t],t,ω]==FourierTransform[ain Sqrt[κ]-1/2 κ a[t]-I E^(I t Ω) g b[t],t,ω],-I ω FourierTransform[b[t],t,ω]==FourierTransform[bin Sqrt[Γ]-I E^(-I t Ω) g a[t]-1/2 Γ b[t]-I Ω b[t],t,ω]}*)

How can I make Mathematica apply FourierTransForm in every term of a differential equation

With the method of Workarounds for a possible bug in the linearity of FourierTransform I define a shell but it dosen't work well for some term.

ft[(h : List | Plus | Equal)[a__], t_, w_] := ft[#, t, w] & /@ h[a]
ft[a_ b_, t_, w_] /; FreeQ[b, t] := b ft[a, t, w]
ft[a_ E^(-I b_ t_) , t_, w_] /; FreeQ[b, t] := ft[a + b, t, w]
ft[a_, t_, w_] := FourierTransform[a, t, w]
eq = { eq = {a'[t] == -κ/2 a[t] - I g b[t] E^(I Ω t) + 
        Sqrt[κ] ain , 
      b'[t] == -Γ/2 b[t] - I Ω b[t] - 
        I g a[t] E^(- I Ω t) + Sqrt[Γ] bin}}
ft[eq, t, ω]*)

Then I get a result

(*{-I ω FourierTransform[a[t],  t, ω] == -(1/2) κ FourierTransform[a[t],t,ω]+ Sqrt[κ] FourierTransform[ain[t], t, ω] - I g FourierTransform[E^(I t Ω) b[t], t, ω],                 -I ωFourierTransform[b[t], t, ω] == -I g FourierTransform[E^(-I t Ω) a[t], t,ω]- 1/2 Γ FourierTransform[b[t], t, ω] - I Ω FourierTransform[b[t], t, ω] +Sqrt[Γ] FourierTransform[bin[t], t, ω]}*)

The term "FourierTransform[ E^(-I t Ω) a[t], t, ω]" is uncalculated. It is improper to direct added a "Times" command in the first shell. And even more, I wonder how can I deal with the nonlinear conditional with a term "a[t] b[t]" ?


marked as duplicate by xzczd, user9660, RunnyKine, m_goldberg, J. M. will be back soon May 8 '16 at 17:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Different from previous problem there is a term have the Command Times a[t] E^(- I Ω t) or even more I want to ask how to deal with the term a[t]*b[t] using mathematica. Must I write a shell according to the property of Fourier Transform by myself? $\endgroup$ – user39156 May 9 '16 at 9:19
  • 1
    $\begingroup$ Yes, writing shell ourselves seems to be the only available solution currently. As to the a[t] E^(- I Ω t) term, except for the programming issue, you misremember the corresponding rule, in a word, it should be something like ft[f_[t_] E^(Complex[0, c_] b_ t_), t_, w_] /; FreeQ[b, t] := ft[f[t - c b], t, w] . Rule 109 here isn't hard to implement, too. But why you need them? as far as I can tell, these rules are just useless when solving differential equations. $\endgroup$ – xzczd May 10 '16 at 2:23
  • $\begingroup$ Thx, I got it. It looks I should write the rule that I want to use by myself. Here I need the Rule 109 you mentioned. For, I am researching a nonlinear coupled system, and I should get some porperty of this system in frequency domain. Thanks again. $\endgroup$ – user39156 May 10 '16 at 2:45
  • $\begingroup$ Oh, just noticed I've made a mistake when implementing rule 103, it should be ft[f_[t_] E^(Complex[0, c_] b_ t_), t_, w_] /; FreeQ[b, t] := ft[f[t], t, w + c b] $\endgroup$ – xzczd May 10 '16 at 2:50
  • $\begingroup$ I just include rule 103 and 109 in the linked answer, have a look. $\endgroup$ – xzczd May 10 '16 at 3:34