How does one calculate the area of a rectangle using a single integral? I tried to ask this in a different way and did not correctly explain myself.
I am ok integrating the line $y = x$ , let us say from $0$ to $2$ using calculus.
If I want to get the square I can easily multiply by two and using calculus the dimensions work.  The area is a square and when we integrate we have a square.
Here is my question.  If I use a straight line above the x axis my equation becomes $y$ = ( some constant)  . Now I use calculus and integrate from 0 to 2 , I also get the correct answer BUT I have to imagine it is a rectangle because when you ingtegrate you have one $x$ term and it is not a square.  The answers match OK it's the dimensions that bother me.  
I did not do a good job explaining this on my previous question. Sorry 
 A: The dimensions do work correctly in case of a rectangle as well. Let us say the height of the rectangle is $k$ and width is $b-a$.
Recall that integration is basically summing up infinitely many small rectangles with infinitesimally small widths.
$$\begin{aligned}\text{Area }&=\lim_{n\to \infty}\sum_{i=1}^{n}\underbrace{k}_{\text{height}}\cdot\underbrace{\left(\dfrac{b-a}{n}\right)}_{\text{width of each infinitesimal rectangle}}\\&=\int_{a}^{b}\underbrace{k}_{\text{units}}\underbrace{\mathrm dx}_{\text{units}}\\&=kx\biggr|_{a}^{b}=k(b-a) \text{ sq. units}\end{aligned}$$
A: Consider a rectangle formed by the equation $y=K$ extending from $x=a$ to $x=b$. 


Calculate the area of a small rectangular strip formed by the coordinates $(x,0)$, $(x+dx,0)$,$(x+dx,y)$ and $(x,y)$.
The area of this rectangle will be, $ydx$. Convert the whole rectangular area into smaller rectangles of area $ydx$ and sum all of them from $x=a$ to $x=b$ using integration.
The area under the curve $y=f(x)$ bounded by the X Axis and the lines $x=a$ and $x=b$ is given by,
$$\int_{x=a}^{x=b}ydx=\int_{x=a}^{x=b}f(x)dx=\int_{x=a}^{x=b}Kdx=K(b-a)$$
Hope this helps...
