Let $X,Y $ be two independent random variables with exponential distribution and parameter $\lambda > 0$. Let $X,Y$  be two independent random variables with exponential distribution with parameter $\lambda > 0$. Let $S = X + Y$ and $T = \frac{X}{S}$. I want to find the joint density function of $(S,T)$ . I want then to calculate the marginals and say whether or not $S$ and $T$ are independent. 
I start  by finding the density function of $S$ using the convolution: 
$$ f_S(s) = \int_{-\infty}^{+\infty}f_X(s-t)f_Y(t)dt $$
$$ = \int_{0}^{s} \lambda^2 e^{-\lambda s} dt  = \lambda^2 e^{-\lambda s}$$
Then I tried to calculate the density function of $T $ but I am stuck here:
$$ F_T(t) = \mathbb{P}(T \leq t) = \mathbb{P}\left(\frac{X}{X+Y} \leq t\right).$$
Is this the right method of solving this? Should I find the joint density first? (The problem is that I do not know how to to that)
 A: Assuming you mean $\lambda$ is the rate parameter here (i.e. Exponential with mean $1/\lambda$).
First of all, recheck your density of $S$. The correct density as mentioned in comments is $$f_S(s)=\lambda^2se^{-\lambda s}\mathbf1_{s>0}$$
It is easy to verify that the density of $T$ is $$f_T(t)=\mathbf1_{0<t<1}$$
You can find the joint distribution function of $(S,T)$ as follows:
For $s>0$ and $0<t<1$,
\begin{align}
P(S\le s,T\le t)&=P\left(X+Y\le s,\frac{X}{X+Y}\le t\right)
\\&=\iint_D f_{X,Y}(x,y)\,dx\,dy\quad\quad,\text{ where }D=\{(x,y):x+y\le s,x/(x+y)\le t\}
\\&=\lambda^2\iint_D e^{-\lambda(x+y)}\mathbf1_{x,y>0}\,dx\,dy
\end{align}
Change variables $(x,y)\to(u,v)$ such that $$u=x+y\quad,\quad v=\frac{x}{x+y}$$
This implies $$x=uv\quad,\quad y=u(1-v)$$
Clearly, $$x,y>0\implies u>0\,,\,0<v<1$$
And $$dx\,dy=u\,du\,dv$$
So again for $s>0\,,\,0<t<1$,
\begin{align}
P(S\le s,T\le t)&=\lambda^2\iint_R ue^{-\lambda u}\mathbf1_{u>0,0<v<1}\,du\,dv\qquad,\text{ where }R=\{(u,v):u\le s,v\le t\}
\\&=\left(\int_0^s \lambda^2 ue^{-\lambda u}\,du\right) \left(\int_0^t \,dv\right)
\\\\&=P(S\le s)\,P(T\le t)
\end{align}
This proves the independence of $S$ and $T$, with $S$ a Gamma variable and $T$ a $U(0,1)$ variable.
And from the joint distribution function, it is readily seen (without differentiating) that the joint density of $(S,T)$ is $$f_{S,T}(s,t)=\lambda^2 se^{-\lambda s}\mathbf1_{s>0,0<t<1}$$
Note that the change of variables isn't really necessary if you are comfortable with the first form of the double integral.
A: The joined density is defined as
$$f_{S,T}(s,t) \\= \int _0^{\infty }\int _0^{\infty }\lambda ^2 e^{-\lambda  (x+y)} \delta (s-x-y) \delta \left(t-\frac{x}{x+y}\right)dydx\tag{1a}$$
Here $\delta(x)$ is the Dirac delta function.
Changing variables $x\to u v, y\to u(1-v)$ gives $u\in (0,\infty), v\in (0,1)$, the modulus of the Jacobian $u$, so that the integral becomes
$$f_{S,T}(s,t) \\=\int _0^{\infty }\int _0^1\lambda ^2 u e^{-\lambda  u} \delta (s-u) \delta (t-v)dvdu\\=
\lambda ^2 s e^{-s \lambda } \left\{ 
\begin{array}
{ll} 
1 & 0\lt t \lt 1 
\\ 0 & \, \textrm{otherwise} 
\end{array} \right.\tag{1b}$$
On the other hand we have for the separate density functions
$$f_{S}(s)\\= \int _0^{\infty }\int _0^{\infty }\lambda ^2 e^{-\lambda  (x+y)} \delta (s-x-y)dydx = \lambda ^2 s \; e^{-\lambda s}\tag{2a}$$
$$f_{T}(t) \\= \int _0^{\infty }\int _0^{\infty }\lambda ^2 e^{-\lambda  (x+y)} \delta \left(t-\frac{x}{x+y}\right)dydx \\ 
= \left\{ 
\begin{array}
{ll} 
1 & 0\lt t \lt 1 
\\ 0 & \, \textrm{otherwise} 
\end{array} \right.\tag{2b}$$
And, finally, from $(1)$ and $(2)$ we have
$$f_{S,T}(s,t) = f_{S}(s) f_{T}(t)\tag{3}$$
which shows the independence of $s$ and $t$.
