$$\cos{x} + \cos{2x} + \cos{3x} \ldots = y$$
$$ 2\cos{x} + 2\cos{2x} + 2\cos{3x} \ldots = 2y $$
By grouping every alternate term by $\cos{A} + \cos{B} = 2\cos(\frac{A+B}{2})\cos(\frac{A-B}{2})$
$$ \cos{x} + \cos{2x} + 2\cos{x}\left(\cos{2x} + \cos{3x} + \cos{4x} \ldots\right) = 2y$$
$$\cos{x} - 1 + 2\cos{x}\left(\cos{x} + \cos{2x} + \cos{3x} \ldots\right) = 2y$$
$$ \cos{x} - 1 + 2\cos{x}\cdot y = 2y$$
$$y = -\frac{1}{2}$$
Me and my friend are confused right now. We don't see anything mathematically wrong but still by logic, it doesn't seem right. Please explain us our errors . We are high school students with basic knowledge of limits and calculus. If possible, please elaborate on the solution.