# PDF with f given piecewise

#### Markov

##### Member
Given $u_t+u_x\cos t=u.$

a) Find the solution with $u(x,0)=f(x).$
b) If $f(x)=\left\{\begin{array}{cl}\cos^2x,&\text{if }-\frac\pi2\le x\le\frac\pi2,\\ 0,&\text{in the rest}.\end{array}\right.$
Describe $u(x,t)$ for $t\ge0.$

I have to use Fourier transform, but don't know how to apply it for $u_x\cos t.$ As for part b), I don't know how to describe $u(x,t).$
Thanks for the help!

#### ThePerfectHacker

##### Well-known member
インテグラルキラー;439 said:
Given $u_t+u_x\cos t=u.$

a) Find the solution with $u(x,0)=f(x).$
b) If $f(x)=\left\{\begin{array}{cl}\cos^2x,&\text{if }-\frac\pi2\le x\le\frac\pi2,\\ 0,&\text{in the rest}.\end{array}\right.$
Describe $u(x,t)$ for $t\ge0.$

I have to use Fourier transform, but don't know how to apply it for $u_x\cos t.$ As for part b), I don't know how to describe $u(x,t).$
Thanks for the help!
As in the other post if you apply Fourier Transform with respect to $x$ then treat $\cos t$ as just a constant.

To find Fourier transform of $f(x)$ you do the following:
$$\hat f (\omega) = \int \limits_{-\infty}^{\infty} f(x) e^{-ix\omega } dx = \int \limits_{-\pi/2}^{\pi/2} \cos^2 x \cdot e^{-ix\omega} dx$$
The reason is that $f(x) = 0$ outside the interval $(-\pi/2,\pi/2)$ anyway, so you are only working on that interval.

#### Markov

##### Member
So I have, $\dfrac{\partial U}{\partial t}+iwU\cos t=U,$ so this is a homogeneous ODE. So you actually applied Fourier transform to the initial condition, right?

Last edited:

#### ThePerfectHacker

##### Well-known member
インテグラルキラー;474 said:
So I have, $\frac{\partial U}{\partial t}+iwU\cos t=U,$ so this is a homogeneous ODE. So you actually applied Fourier transform to the initial condition, right?
Yes that is the differencial equation after hitting it with a Fourier transform.

Now as if $U(\omega,t)$ is Fourier transform of $u(x,t)$ then as $u(x,0) = f(x)$ it means that $U(\omega, 0) = \hat f(\omega)$.
Where $\hat f(\omega)$ is the Fourier transform of the initial condition $f(x)$.

So you have the equation,
$$\frac{\partial U}{\partial t} + i\omega \cos t U = U \text{ and } U(\omega , 0 ) = \hat f(\omega)$$

#### Markov

##### Member
I'm a bit stuck on solving the ODE, since $U=U(w,t)$ and $\cos(t)$ both depend of $t,$ how to proceed?

#### ThePerfectHacker

##### Well-known member
I'm a bit stuck on solving the ODE, since $U=U(w,t)$ and $\cos(t)$ both depend of $t,$ how to proceed?
Basically this is like an ODE with $\omega$ being a constant. Do you remember the formula for "linear-first order ODE's"?

How do you solve something like $y' + p(x)y = q(x)$. Remember the formula for that?