Do the following rewrites:
sin(x) = sin(4x - 3x) = sin(4x) cos(3x) - cos(4x) sin(3x)
sin(7x) = sin(4x + 3x) = sin(4x) cos(3x) + cos(4x) sin(3x)
sin(3x) = sin(4x - x) = sin(4x) cos(x) - cos(4x) sin(x)
sin(5x) = sin(4x + x) = sin(4x) cos(x) + cos(4x) sin(x)
cos(x) = cos(4x - 3x) = cos(4x) cos(3x) + sin(4x) sin(3x)
cos(7x) = cos(4x + 3x) = cos(4x) cos(3x) - sin(4x) sin(3x)
cos(3x) = cos(4x - x) = cos(4x) cos(x) + sin(4x) sin(x)
cos(5x) = cos(4x + x) = cos(4x) cos(x) - sin(4x) sin(x)
So in the numerator, we have
sin(x) + sin(3x) + sin(5x) + sin(7x)
= 2 sin(4x) cos(3x) + 2 sin(4x) cos(x)
= 2 sin(4x) (cos(3x) + cos(x))
In the denominator,
cos(x) + cos(3x) + cos(5x) + cos(7x)
= 2 cos(4x) cos(3x) + 2 cos(4x) cos(x)
= 2 cos(4x) (cos(3x) + cos(x))
So we have
(sin(x) + sin(3x) + sin(5x) + sin(7x)) / (cos(x) + cos(3x) + cos(5x) + cos(7x))
= (2 sin(4x) (cos(3x) + cos(x))) / (2 cos(4x) (cos(3x) + cos(x)))
= sin(4x) / cos(4x)
= tan(4x)
QED