Simplifying a Trigonometric Expression

I need to provide a simplified version of this expression for a homework:

$$\frac{\cos^{3}x - 2\cdot\cos x + \sec x}{\cos x \cdot \sin^{2}x}$$

Basically, there aren't restrictions. The simpler the final formula, the better. I've been trying to reduce this expression with the main idea of replacing trigonometric function with $\cos$ equivalents (as it appears more frequently, thus could be simplified), but this led me to nowhere.

$$\frac{\cos^{3}x - 2\cdot\cos x + \frac{1}{\cos x}}{\cos x (1 - \cos^{2}x)}$$

I've also tried other substitutions with no success.

Any tip on direction to take from here are really appreciated. I see there is a lot of work to be done, and I know I haven't walked so much in direction to finishing it. The problem is that I don't have any idea to continue this.

-

We can multiply the numerator and denominator by $\cos(x)$ and get, $$\frac{\cos^4(x) - 2 \cdot \cos^2(x) + 1}{\cos^2(x) \cdot \sin^2(x)}$$ $$= \frac{\left(\cos^2(x) - 1 \right)^2}{\cos^2(x) \cdot \sin^2(x)}$$ $$= \frac{\left(-\sin^2(x) \right)^2}{\cos^2(x) \cdot \sin^2(x)}$$ $$= \frac{\sin^4(x)}{\cos^2(x) \cdot \sin^2(x)}$$ $$= \frac{\sin^2(x)}{\cos^2(x)}$$ $$= \tan^2(x)$$

-
Your answer is excellent! Just to let you know, most users of this site have agreed not to give complete solutions to questions tagged as “homework”. You can however give generous hints. –  user3180 May 4 '11 at 0:59
@Joe I know, I didn't see the homework tag until I already submitted it... which is why I upvoted yours and not mine –  Nicolas Villanueva May 4 '11 at 0:59
you can also use \sin and \cos for trig functions to get rid of the italic font. –  yunone May 4 '11 at 1:27
Well, thank you a lot Nicolas! What else can I say? –  sidyll May 4 '11 at 1:37
@yunone I wasn't sure whether or not I could, and I was in a hurry so I didn't want to look it up online, but thanks, I'll be sure to use it next time ^_^. @sidyll remember that this only holds when x is not a multiple of pi/2 (90 degrees) since we had cos and sin in the denominator. –  Nicolas Villanueva May 4 '11 at 3:17

Try multiplying the numerator (and denominator) by $\cos(x)$. Then the numerator will be a fourth degree expression of the form $t^4-2t^2+1$. (where I have used $t$ in place of $\cos(x)$). This expression is a perfect square and can be factored. You should then be able to cancel some terms from the numerator and denominator.

-
Thank you Joe. I ended up marking the other answer as correct, as it shows the complete solution. I hope you understand! But your explanation was certainly helpful, it was the kind of answer I was waiting. I'm sure I'd continue and find the solution after reading it. Thanks again! Best wishes –  sidyll May 4 '11 at 1:42