# Calculating risk interest rate within a two period model

I am trying to calculate how to determine the interest rate ( = risk free rate + premium) within the following model where a consumer decides to invest in a safe asset or in a risky asset. The utility is a CRRA function: $$U(C) = \frac{c^{1-\frac{1}{\sigma}}}{1-\frac{1}{\sigma}}$$ where $$\sigma$$ is the intertemporal elasticity of substitution. Hence, the consumer decides to maximize its utility by the following max problem where $$1-p$$ is the probability of default (consumer) does not get its savings + return back and $$p$$ is the probability of no default.

$$max \: U = u(c_1) + \beta E [(1-p)u(c_2(D))] + \beta E [(p) u(c_2(s))]$$

and he faces the following budget constraints:

$$C_1 = Y_1 - T_1 - S^1 - S^2$$

for period 2 consumption in case of default and no default:

$$C_2 (D) = Y_2-T_2+(1+r^1)S^1$$ $$C_2 (S) = Y_2 - T_2 + (1+r^1)S^1 + (1+r^2)S^2$$

So, I substituted these two budget constraints in the maximization problem and differentiated with respect to savings (1) and savings (2) and got the following Euler equations:

$$u^\prime(C_1) = \beta (1+r^1) E [(1-p)u^\prime (C_2(D))] + \beta (1+r^1) E[p u^\prime(C_2(S))]$$ $$u^\prime(C_1) = \beta E[p (1+r^2) u^\prime(C_2(S))]$$

The risk free rate, $$r^1$$ is exogenously determined. I am trying to calculate $$r^2$$ by dividing the first Euler equation by the other, since the marginal utility of period 1 consumption is equal to each other. However, I can not find a solution, am I doing this corrrect?