An object with weight W is dragged

An object with weight W is dragged along a horizontal plane by a force acting along a rope attached to the object. If the rope makes an angle θ with the plane, then the magnitude of the force is F=μW/μ sin θ + cos θ where μ is a positive constant called the coefficient of friction and where 0 ≤ θ ≤ π/2.
Show that F is minimized when tan θ = μ.