I have a question on finding the horizontal velocity component of a rotating bar in a (periodic) circular motion. Consider a bar rotating with angular motion: $$ \theta(t) = A \sin (kt) $$
where $A$ is amplitude, $k$ is a constant, and $t$ is time.
The bar rotates from initial position $M$ to $M'$ with angular velocity $\omega = \dot{\theta}$. Let's consider a horizontal axis $p$ intersecting the rotating bar at a fixed distance $d$. At $M'$, the transverse velocity is given as: $$ v_t = \omega d' $$
where $d' = d / \cos \theta$.
Here, to find the horizontal velocity component $v_x$ of the bar at M', I have expressed it as (including time derivative of $\theta$):
$$ v_x = v_t \cos \theta $$ $$ v_x = k A \cos (kt) (d/\cos\theta) \cos\theta $$ $$ v_x = k A d \cos (kt) $$
To verify this, I tried a second method by defining the displacement of $q$ along $p$ axis as following:
$$ s = d \tan \theta $$
and performs time derivative of s to get the horizontal velocity $v_x'$ as followings:
$$ v_x' = \frac{ds}{dt} = k A d \cos(kt) [\tan^2(\theta) + 1] $$
The results are different by a factor of $(1+\tan^2(\theta))$. Is there a missing component in the derivation of $v_x$ ?