Course I am taking is of a mathematical take on signal processing. This is a question from an old exam.
Let a system be causal and continuous, given the transfer function
\begin{equation} H(s) = \frac{a}{s+b} \end{equation}
let \begin{equation} \begin{split} x(t) &= \sin(t) \\ y(t) &= \sqrt{2} \sin\left(t-\frac{\pi}{4}\right) \\ \end{split} \end{equation}
find $a$ and $b$.
My take on this problem:
Finding $Y(s)$ \begin{equation} \begin{split} y(t) &= \sqrt{2} \sin\left(t-\frac{\pi}{4}\right) \\ &= \sqrt{2}\left( \sin(t) \cos\left(-\frac{\pi}{4} \right) + \cos(t) \sin\left(-\frac{\pi}{4} \right) \right) \\ &= \sqrt{2}\left( \frac{sin(t)}{\sqrt(2)} - \frac{cos(t)}{\sqrt(2)} \right) \\ &= \sin(t) - \cos(t) \\ Y(s) &= \frac{1}{s^2 + 1} - \frac{s}{s^2+1} \\ &= \frac{1-s}{s^2+1} \end{split} \end{equation}
Solving for $a$ and $b$
\begin{equation} \begin{split} Y(s) &= H(s)X(s) \Rightarrow H(s) = \frac{Y(s)}{X(s)} \\ \frac{a}{s+b} &= \frac{\frac{1-s}{s^2+1}}{\frac{1}{s^2+1}} = 1 -s\\ \end{split} \end{equation}
Which is not correct. What am I doing wrong?
The solutions is
\begin{equation} \begin{split} a &= 2 \\ b &= 1 \end{split} \end{equation}
Note that $y(t)$ is not a causal solution, it starts with $y(0)=-1$. It is the stationary solution, that is the output you get if you plug in $x(t)$ and wait infinitely long until the transition part dies. However, the stationary solution is a particular solution to the differential equation that represents the system, that is $$ \dot y(t)+by(t)=ax(t). $$ Now take the given functions and identify $a$, $b$, by setting e.g. $t=0$ and $t=\frac{\pi}{4}$.
Another way to do it is to "read out" from the output that the amplitude at the frequency one is $\sqrt{2}$ and the phase shift is $-\frac{\pi}{4}$, i.e. $$ H(i)=\frac{a}{i+b}=\sqrt{2}e^{-i\pi/4}=1-i. $$
P.S. The last method is related to what you did in your solution with that difference that you were thinking on one-sided Laplace transform, but it should be two-sided one. The two-sided Laplace transform of a pure oscillation at a frequence $\omega$ contains the distribution part $\delta(s-i\omega)$. It is how your equation $$ H(s)=\frac{a}{s+b}=1-s $$ becomes valid only for $s=i$.