I tried it this way:
$$ 40\cosθ+9\sinθ=41 $$
$$ 9\sinθ=41-40\cos\theta $$
Squaring both the sides:
$$81\sin^2\theta=1681+1600\cos^2\theta-2\cdot 40\cdot 41 \cos\theta$$
$$81-81 \cos^2\theta= 1681+1600\cos^2\theta-3280 \cos\theta$$
$$1681\cos^2\theta-3280\cos\theta+1600=0$$
Solving the quadratic equation gives $\cos\theta=\dfrac{40}{41}$. It is not easy to solve the quadratic equation without calculator so there must be some other method, if yes then please explain.
P.S: I've found the other method so I am self-answering the question.
Using Brahmagupta-Fibonacci Identity,
$$(9\sin\theta+40\cos\theta)^2+(40\sin\theta-9\cos\theta)^2=(40^2+9^2)(\sin^2\theta+\cos^2\theta)=41^2$$ as $41^2=40^2+9^2$
So, $40\sin\theta-9\cos\theta=0$ and $9\sin\theta+40\cos\theta=41$
Can you solve for $\cos\theta$