Answer
$\theta=26.9^{\circ},\space D=6.88\space km$
Work Step by Step
Here we use the component method to find solutions.
The net displacement of the sailboat is zero. Because the finish line is coincident with the starting line.
Considering the horizontal direction, we can write.
$R_{h}=A_{h}+B_{h}+C_{h}+D_{h}=0$ ; Let's plug known values into this equation.
$3.2\space km\times cos40^{\circ}-5.1\space km \times cos35^{\circ}-4.8\space km\times cos23^{\circ}+Dcos\theta=0$
$Dcos\theta=6.14\space km-(1)$
Considering the vertical direction, we can write.
$R_{v}=A_{v}+B_{v}+C_{v}+D_{v}=0$ ; Let's plug known values into this equation.
$3.2\space km\times sin40^{\circ}+5.1\space km \times sin35^{\circ}-4.8\space km\times sin23^{\circ}+Dsin\theta=0$
$Dsin\theta=3.11\space km-(2)$
$(2)\div(1)=\gt$
$tan\theta=\frac{3.11\space km}{6.14\space km}=\gt\theta=tan^{-1}(0.51)=26.9^{\circ}$
(1)=>
$D=\frac{6.14\space km}{cos26.9^{\circ}}=6.88\space km$