I was studying the first question of this solution and I don't understand how the professor used integrating factor to solve for the question. My confusion occurs right at the second line of this part:
I do not understand why he is integrating $e^{(\lambda_n^2-r)\tau}$ from $0$ to $t$.
My solution just do indefinite integral and get
$$e^{\lambda_n^2t}v_n = \frac{\sigma_ne^{(\lambda_n^2-r)t}}{\lambda_n^2-r}$$
Someone please help...!

Your indefinite integral result should have a constant $c_n'$ at the end
$$e^{\lambda_n^2t}v_n = \frac{\sigma_ne^{(\lambda_n^2-r)t}}{\lambda_n^2-r}+c_n'$$
where $c_n'$ differs from $c_n$ by
$$c_n' - c_n =- \frac{\sigma_n}{\lambda_n^2-r}$$
The two integral results are equivalent.