CDF function formed by vertices. Below is the problem:
Choose a point uniformly at random from the triangle with vertices (0,0), (0, 30), and (20, 30). Let (X, Y ) be the coordinates of the chosen point. (a) Find the cumulative distribution function of X. (b) Use part (a) to find the density of X.
First, for the first part of the question, a triangle is formed by three vertices in the question. Therefore it would look something like an inverted triangle whose right angle is formed by y-axis and the line that goes through (0,30) and (20, 30)
If I find the area of this triangle it would be 300 since 
(30)(20) / 2 = 300
so for (X, Y) coordinates in the area, the probability of the point being in the triangle is 1/300.
So to find cdf, since the equation of the line that goes through the origin and (20, 30) is y = (3/2)x, I think cdf is
F(X) = 
1. (3/2)x * x * 1/2 * 1/300 = (1/400) * x^2 for 0 <= x <= 20
2. 0 for x < 0
3. 1 for x > 20
But I am not really sure if my process is right 
For part (b), I know I just have to take the derivative but the if I take the derivative, I am only calculating the area of the slope but I am suppose to find the area of the inverted triangle.
Since the area of two triangles are equal, can I just take the derivative? or should the area be something like 1 - (derivative) ?
 A: We want the cdf $F_X(x)$ of $X$. So we want to find an expression for $\Pr(X\le x)$.
Let I forget, if $x\lt 0$, then $\Pr(X\le x)=0$, so $F_X(x)=0$. And if $x\gt 20$, then $\Pr(X\le x)=1$.
We now deal with the interesting part, when $0\le x\le 20$. Draw the vertical line that goes through the point $(x,0)$. We want the probability that $X$ lands in the region $K$ which is to the left of our vertical line, and inside the triangle.
This probability is the area of $K$, divided by the area $300$ of the full triangle.  
The region $K$ is a trapezoid, one base equal to $30$. What is the other base? The line oining $(0,0)$ to $(20,30)$ has equation $y=\frac{3x}{2}$. So the other base is $30-\frac{3x}{2}$. 
The "height" of the trapezoid is $x$. So the area of $K$, after a little simplification, is $x\left(30-\frac{3x}{4}\right)$. Finally, divide by $300$.
For the density function, differentiate.  Don't forget about the parts outside $(0,20)$.
A: Since both $X$ and $Y$ are continuous random variables, the probability of a specific point is actually zero, $\frac{1}{300}$ is not a probability, it is the joint density function. Since the point is chosen randomly, the joint distribution is uniform over the region defined by the triangle:
$$
f_{X,Y}(x,y) = \left \{
\begin{array}{rl}
\frac{1}{300} & 0 < x < 20, \frac{3}{2}x < y < 30\\
0 & \text{otherwise}
\end{array}
\right .
$$
From this you can compute the marginal PDF of $X$, as
$$f_X(x) = \int_{-\infty}^{\infty} f_{X,Y}(x,y) dy = \int_{\frac{3}{2}x}^{30} \frac{1}{300} dy$$
And from this you can compute the CDF of $X$ as
$$F_X(x) = \int_{-\infty}^{x} f_{X}(t) dt $$
Another view: 
$$F_X(x) = P(X < x) = P(X < x, Y < 30) = \int_{0}^{x}\int_{\frac{3}{2}x}^{30}  \frac{1}{300} dydx$$
Geometric interpretation
The joint PDF is the height of a uniform triangular prism whose base is the triangle in the $XY$ plane where the point is chosen. To visualize $P(X < x, Y < 30)$, imagine that you cut that prism at $X=x$ (some point between 0 and 20), parallel to its height, and you keep the part that goes from $0 < X < x$. That part would be now a general prism with the same height and a base that is in general a trapezoid. The CDF of $X$ would be then the volume of that prism. You can see then that as you move your "cutting" point $x$ to 20, your general prism becomes the uniform triangular prism, whose volume is 1, which agrees with the fact that $F_X(\infty)=1$.
You can compute $F_X(x)$ using geometric arguments, by multiplying the area of base of the general prism that you kept times its heigth $\left(\frac{1}{300}\right)$, or you can integrate, as was shown before.
