There are general algorithms to determine whether two regular expressions represent the same language. A classic approach is described here.
The expression given by your teacher, $E=(\lambda+ a a^*b(ab)^*)(\lambda + b(a+b)^*)$ does not correspond to the DFA shown. For example, string $aba^2b$ is accepted by the DFA. However, it is not in $E$.
By distributive law,
$(\lambda+ a a^*b(ab)^*)(\lambda + b(a+b)^*) = \lambda+ a a^*b(ab)^* + b(a+b)^* + aa^*b(ab)^*b(a+b)^*$
- $aba^2b\not = \lambda$
- A string in $a a^*b(ab)^*$ does not contain $a^2$ after the first $b$.
- A string in $b(a+b)^*$ starts with $b$
- A string in $(a a^*b(ab)^*)b(a+b)^*$ contains $b^2$ since a string in $(a a^*b(ab)^*)$ must end with $b$.
Your solution, $F=(a a^*b)^*(\lambda + b(a+b)^*)$ is correct. The correctness is justified by the methodical procedure you have done.
For this simple case, we can also verify it by straightforward reasoning, which is basically paraphrasing the procedure.
An accepted string either ends up in state $q_1$ or $q_0$.
A string ends up in state $q_1$ iff the DFA will transition from $q_1$ to $q_2$ and back to $q_1$ zero or more times, each time reading one or more $a$s followed by one $b$. That means $(aa^*b)^*$
A string ends up in state $q_0$ iff the DFA will reach $q_1$, then transition from $q_1$ to $q_0$, then loop at $q_0$ zero or more times.
- Reaching $q_1$ entails $(aa^*b)^*$.
- Transitioning from $q_1$ to $q_0$ entails one $b$.
- Looping at $q_0$ entails $(a+b)^*$.
Concatenating three pieces together, we get $(a a^*b)^*b(a+b)^*$.