By drawing graph,or otherwise,find the number of roots of the equation $x+2 \tan(x)= \pi/2$
lying between $0$ and $2\pi$, and find the approximate value of the largest root.
I found 3 roots by drawing a rough graph ,but i am unable to find the value of any roots. I would be glad if anyone could tell me how to find the value of roots. Secondly is there any other way beside drawing a graph to know the number of roots.
Drawing the graph, you identify that the three roots are located close to $x=0.5$, $x=2.5$ and $x=5.0$.
The solutions of equations such as the one you post do not have solutions which can be expressed using elemental functions (I do not thing that, even using complex functions, there is any analytical solutions). So, only numerical methods for root finding could be used. There are many methods for solving non linear equations provided that a resonable starting value if known.
Since I do not know what you already learnt in this area, I think that the simplest could be inspection. Suppose we note $$f(x)=x+2 \tan (x)-\frac{\pi }{2}$$ $f(5)=-3.33183$ but $f(5.5)=1.93804$ so the root is between $5$ and $5.5$. Let us try at the middle of the range and find that $f(5.25)=0.324551$; so the solution is between $5.00$ and $5.25$. Let us try again at the middle of the range and find that $f(5.125)=-1.01473$; so the solution is between $5.125$ and $5.250$. We already reduced the range significantly; so compute the equation of the line which goes through the two points $(5.125,-1.01473)$ and $(5.250,0.324551)$ and compute the $x$ intercept (I let you doing this part of the work); you will find an approximate solution at $x=5.212$ for which $f(5.212)=-0.0231588$ which is quite small.
The exact solution of the problem is $x=5.21439$.
For sure, there are much more sohisticated and much faster methods for computing the root. If you wish, I could elaborate.
Added later to my answer
One of the simplest and more popular methods for solving nonlinear equations is Newton. Starting from a guess, the iterative scheme for solving $f(x)=0$ is given by $$x_{n+1}=x_n-\frac {f(x_n)}{f'(x_n)}$$ Let us apply this to the function $$f(x)=x+2 \tan (x)-\frac{\pi }{2}$$ $$f'(x)= 2 \sec ^2(x)+1$$ Now, let us start with $x_0=5$ as before. The successive iterates will then be $5.12886$, $5.20172$, $5.21413$, $5.21439$ which is the solution for six significant figures.
There are methods which converge faster such as Halley. For this one, the iterative scheme is $$x_{n+1}=x_n-\frac {f(x_n)}{f'(x_n)} (1+\frac {f(x_n)f''(x_n)}{2f'(x_n)^2})$$ For your equation, we have $$f''(x)=4 \tan (x) \sec ^2(x)$$ Let us start again with $x_0=5$ as before. The successive iterates will then be $5.18283$, $5.21432$,$5.21439$.