Prove that function Y=sin^px.cos^qx has maximum value at tanx=root of p/q

Curious Brain's image