Can we use a cosine-fourier -expansion for a sine function?

57 Views Asked by At

I have a heat equation with the following conditions :

$$\begin{aligned} \frac{\partial u}{\partial t} &=\frac{\partial^{2} u}{\partial x^{2}} &&\text { for } 0<x<\pi, t>0 \\ \frac{\partial u}{\partial x}(0, t) &=\frac{\partial u}{\partial x}(\pi, t)=0 &&\text { for } t \geq 0, \\ u(x, 0) &=\sin (x)&& \text { for } 0 \leq x \leq \pi \end{aligned}$$

I am stuck at the part where we consider the initial condition $u(x,0) = \sin(x) $ as cosine expansion and find the coefficient($c_n$) through :

$$\begin{aligned} c_{n} &=\frac{2}{L} \int_{0}^{L} f(\xi) \cos \left(\frac{n \pi \xi}{L}\right) d \xi =\frac{2}{\pi} \int_{0}^{\pi} \sin \xi \cos (n \xi) d \xi \end{aligned}$$

my question is , depending on orthogonality , if we consider n=1 for sin(x) and m= n for cos (nx) and have the inntegration from 0 to pi , then cos(nx) is orthogonal to sin(x) for every n.

$$\begin{array}{l}\int_{0}^{\pi} \cos (m x) \cos (n x) {dx}=\left\{\begin{aligned} 0, & {~m} \neq {n} \\ \pi / 2, & {~m}={n} \end{aligned}\right. \\ \int_{0}^{\pi} \sin (m x) \sin (n x) {dx}=\left\{\begin{aligned} 0, & {~m} \neq {n} \\ \pi / 2, & {~m}={n} \end{aligned}\right. \\ \int_{-\pi}^{\pi} \sin (n x) \cos (m x) {dx}=0 & \end{array}$$

but it seems this is wrong! as there is a solution for $c_n$!!

on the other side , I tried the same way in other questions that expands sine equations in sine-series or cosine equation in a cosine-series , and it worked out! like this for example:

$$\frac{\partial u}{\partial t}=k \frac{\partial^{2} u}{\partial x^{2}}, \\ u(x, 0)=f(x) \quad u(0, t)=0 \quad u(L, t)=0\\ f(x)=6 \sin \left(\frac{\pi x}{L}\right)$$

I assumed $m=1$ for the first sine function and $n=n$ for the second one , then they are orthogonal everywhere except at $n=1$, where $c_n$ will be $6$.

I am really so confused , why the assumption does not work in all cases?