To maximize \( z = x + y \) subject to the constraint \( x^2 + 5y^2 = 30 \), we can use the method of Lagrange multipliers or apply a substitution based on the constraint.
First, we solve the constraint for \( y^2 \) in terms of \( x \):
\[ 5y^2 = 30 - x^2 \quad \Rightarrow \quad y^2 = \frac{30 - x^2}{5} \]
Next, consider substituting \( y \) back into \( z \):
\[ y = \sqrt{\frac{30 - x^2}{5}} \]
We can now express \( z \) solely in terms of \( x \):
\[ z = x + \sqrt{\frac{30 - x^2}{5}} \]
Now, we will differentiate \( z \) with respect to \( x \) and find the critical points. First, calculate \( z^2 \) for easier differentiation:
\[ z = x + \sqrt{\frac{30 - x^2}{5}} \]
Rewriting gives us:
\[ z = x + \frac{1}{\sqrt{5}} \sqrt{30 - x^2} \]
Let's square \( z \):
\[ z^2 = \left( x + \frac{1}{\sqrt{5}} \sqrt{30 - x^2} \right)^2 \]
For maximization, let's differentiate \( z \):
\[ \frac{dz}{dx} = 1 + \frac{1}{\sqrt{5}} \cdot \frac{1}{2\sqrt{30 - x^2}} \cdot (-2x) \]
Setting the derivative equal to zero for critical points:
\[ 1 - \frac{x}{\sqrt{5(30 - x^2)}} = 0 \]
This implies:
\[ \frac{x}{\sqrt{5(30 - x^2)}} = 1 \]
Squaring both sides gives:
\[ x^2 = 5(30 - x^2) \]
This simplifies to:
\[ x^2 + 5x^2 = 150 \quad \Rightarrow \quad 6x^2 = 150 \quad \Rightarrow \quad x^2 = 25 \quad \Rightarrow \quad x = 5 \]
Substituting \( x = 5 \) back into the constraint to find \( y \):
\[ 5^2 + 5y^2 = 30 \quad \Rightarrow \quad 25 + 5y^2 = 30 \quad \Rightarrow \quad 5y^2 = 5 \quad \Rightarrow \quad y^2 = 1 \quad \Rightarrow \quad y = 1 \]
Finally, the maximum value of \( x + y \) is:
\[ x + y = 5 + 1 = 6 \]
To ensure this is indeed the maximum, we check the endpoints. If \( x = 0 \):
\[ 5y^2 = 30 \quad \Rightarrow \quad y^2 = 6 \quad \Rightarrow \quad y = \sqrt{6} \quad \Rightarrow \quad z = \sqrt{6} \approx 2.45 \]
If \( y = 0 \):
\[ x^2 = 30 \quad \Rightarrow \quad x = \sqrt{30} \quad \Rightarrow \quad z = \sqrt{30} \approx 5.48 \]
Thus, the maximum occurs at \( (5, 1) \).
Thus, the maximum value of \( x + y \) is:
\[ \boxed{6} \]