First, you would find the components of 4 km that is in direction of 52 degrees.
Horizontal component: 4*cos(52) = 2.4626459013 km
Vertical component: 4*sin(52) = 3.15204301443 km
Now Jenny walks 5 km to some direction that gets her back exactly due EAST from the original point. This means, her net vertical displacement was zero!
Since earlier she walked 3.15204301443 km along the vertical direction, she must have walked -3.15204301443 km to come back to original vertical point (try to draw this to make sense out of it, or please do not hesitate to contact).
Since this comes from:
5*sin(a) = -3.15204301443
we can solve her second direction to be:
a = asin(-3.15204301443/5) = -39.080275 degrees
Finally, this gives an additional horizontal distance of:
5*cos(-39.080275 degrees) = 3.88131740717 km.
Thus total horizontal distance is:
2.4626459013 km + 3.88131740717 km = 6.34396330847 km or simply 6.34 km.