Electric potential of a triangle I am stuck with this problem:
The right triangle shown with vertex P at the origin has base b, altitude a, and uniform density of surface charge σ. Determine the potential at the vertex P. First ﬁnd the contribution of the vertical strip of width dx at x. Show that the potential at P can be written as $\phi_P$ = (σb/4π$\varepsilon_o$)ln[(1+sinθ)/cosθ]


What I have done so far:
A tiny box of the strip has width dx and height $rd\theta$ so its contribution to P is
\begin{equation}
d\phi = \frac{(\sigma)(dx)(rd\theta)}{4 \pi \varepsilon_o r}=\frac{(\sigma)(dx)(d\theta)}{4 \pi \varepsilon_o }
\end{equation}
So the contribution of the entire strip would be
\begin{equation}
\frac{\sigma dx}{4 \pi \varepsilon_o}\int_0^{arctan(\frac{a}{b})} d\theta = \frac{\sigma dx}{4 \pi \varepsilon_o} arctan(\frac{a}{b})
\end{equation}
So the potential, $\phi$ would be:
\begin{equation}
\phi = \frac{\sigma}{4 \pi \varepsilon_o} arctan(\frac{a}{b}) \int_0^b dx = b\frac{\sigma}{4 \pi \varepsilon_o} arctan(\frac{a}{b})
\end{equation}
But this is clearly not the answer. What am I doing wrong?
 A: The height of the 'elemental box' is not $rd\theta$ but $r\cos\theta d\theta$. 
This is because $rd\theta$ is the length of an element of arc. At the x axis (y=0) this element is vertical, in the same direction as the strip along which you are integrating. However, if the element of arc is far from the x axis, it is inclined at an angle to the vertical. The factor of $\cos\theta$ takes account of the projection of the element of arc onto the vertical direction.
A: I would set it up as follows: Let $\alpha$ be the angular integration variable.
(Since the symbols $\theta$ and $\phi$ are already used for something else in this problem.)
The area element is the usual one for polar coordinates, $r \, dr \, d\alpha$.
For a given $\alpha$, you have to integrate $r$ from 0 to $b/cos(\alpha)$.
So, 
$$\phi = \int_0^\theta d\alpha \int_0^{b/cos\alpha} rdr \, \frac{\sigma}{4\pi\epsilon_0r}$$
The $r$ integration is trivial, and the $\alpha$ integration is a known one which you can look up 
or work out for yourself.
