A sign problem? Consider a particle moving in a vertical circle of radius $r$. The particle is acted by gravity and it is connected to the center of the circle by a massless rod. 

If I decompose the gravity force into its components along the radial and tangential directions to the circle I get 
$$-mg \hat{j}=-mg(\cos\theta \hat{\theta}+\sin\theta \hat{r}) $$
where $\hat{j},\hat{\theta},\hat{r}$ are unit vectors along the $y,\theta,r$ directions (the positive $\theta$ direction is counterclockwise, and the positive $r$ direction is pointing out of the circle)
If I then apply Newton's second law I get the 2 equations (the first being the tangential component of the force, the second the radial component)
$$-mg\cos\theta =mr\frac{d^{2}\theta}{dt^{2}}\tag{1}$$
$$N-mg\sin\theta = -mr\left(\frac{d\theta}{dt}\right)^{2}\tag{2}$$
where $N$ is just the reaction of the rod on the particle. 
Integrating the first of these equations I get $$-mg\sin\theta=\frac{1}{2}mr\left(\frac{d\theta}{dt}\right)^{2}\tag{3}$$ where I assume that $d\theta/dt=0$ when $\theta=0$ (so the integration constant is zero).
Replacing in the second equation I get
$$N=-\frac{3}{2}mr\left(\frac{d\theta}{dt}\right)^{2}$$
.
which seems wrong since it seems to imply the reaction of the rod to the particle also points to the center of the circle like the radial gravity component. 
I must have done a mistake in a sign somewhere but don't see where.
 A: It is sometimes better to find an answer by a different route and then consider what went wrong or right using the initial problem solving equations.  

Let $N$ be the force exerted by the rod, length $l$, radially inwards and the speed of the mass $m$ be $v$ when the angle between the rod and the horizontal is $\theta$.  
N2L gives $mg \sin \theta+N = \frac {mv^2}{l}$. 
Now consider energy conservation with the speed of the mass equal to $v_o$ when $\theta =90^\circ$.  
$\frac 12 m v^2_o + mgl(1-\sin \theta) =\frac 12 m v^2$
Combining the two equations and eliminating $v$ gives
$N= \frac {mv^2_o}{l}+mg(2-3\sin \theta)$.  
This equation shows that the force exerted on the mass by the rod $N$ depends on the angle $\theta$ and the speed at the top $v_o$ and can be positive or negative.
You might have done a similar solution with a string which can only exert an inward radial force and if the mass is not moving fast enough it fails to execute a circular.
The rod can exert an outward radial force to ensure the mass executes a circular path.

My concern is with your integration of the first equation where you must have included an unspecified initial condition otherwise you would have finished up with a constant of integration.
What was your initial condition?
A: OK it looks like you have
1) integrated a tangential expression for acceleration due to gravity to get
2) an expression for tangential velocity due to gravity.
The change from cos to sin is due to the integration, not a change in direction. 
Which you have
3) then substituted into a radial expression for forces, 
replacing the term for radial gravitational acceleration with tangential velocity due to gravity, which I think is your mistake. 
Just because two terms have the same form doesn't mean they represent the same thing. maybe clearer to say that radial and tangential should be resolved distinctly they are orthogonol.
