what dependence does the intensity of a normal LED(the one used for DIY projects) follow with respect to distance?
"Dependence" is not a thing, but...

There is no physical concept of "dependence of energy", but I believe you are just trying to describe the relationship between energy output and energy received at a given distance. 

Since energy is a cumulative term, we usually refer to its accumulation rate (flux) instead. By analogy, think of energy as the amount of water in a bucket. We could have a bucket with a small opening, that admits only a small flow, we leave under the faucet for a long time -- or -- we could have a wide-open pail that will accumulate the same amount of water in it in a very short time. 

To make a meaningful water measurement, we need to standardize, not only time (instantaneous energy is called power), but the size (area) of the opening we are using to make our measurement. In radiative energy, we call this measurement Intensity.

Intensity = Power / Area

It's that simple. This has nothing to do with LED's, glass, DIY, or anything other than basic optics.

In three dimensions, for a source emitting energy uniformly in all directions the intensity drops off as 
$$\frac{1}{R^2}$$ 
where r is the distance from the source. 

Your assumption about an inverse-square law is not valid here. 

It's called a Lens

See that part above about uniformly in all directions? That plastic lens on your LED makes that assumption incorrect. Lenses focus the radiated energy into a smaller area, thereby increasing the initial intensity and decreasing the rate at which that intensity is lost to distance. 

In RADAR and other EM antenna design, the expression dBi is used to define the gain of an antenna system relative to an isotropic radiator at radio frequencies.

So...

Intensity = Power / Area

In your question, the "area" is actually the area of a sphere of radius R that surrounds the source of power output P:

$$I = \frac{P}{4\pi R^2}$$

That's the surface area of a sphere in the denominator.

However, you are not emitting into the entire sphere, just a narrow cone that the lens constrains. Let's define a term L, which represents the reduction factor in illumination caused by the Lens.

$$L = \frac{A_{lens}}{A_{sphere}}$$

We already know A_sphere (above). To find A_lens consider:



A_lens is the surface area of the sphere above the orange latitude.

To find "h" in the figure, we need to know the lens' radiating angle (this is typically 30degrees half for the type of LED in your picture, but exact value will be available in the part's datasheet).

Using trigonometry we can find...

$$R-h=R*cos(\theta)$$

$$h = R - R*cos(\theta)$$

and therefore the lens area...

$$A_{lens} = 2*\pi*R^2*(1 - cos(\theta))$$

Ta-da! (e.g. the answer)

Putting it all together, we see that power does not decrease at the rate of the inverse-square law, but substantially better -- by a factor of A_lens:

$$I = \frac{P}{A*L}$$
$$I = \frac{P}{\frac{A_{sphere} * A_{lens}}{A_{sphere}}} = \frac{P}{A_{lens}}$$

...and thus:

$$I = \frac{P}{2*\pi*R^2*(1 - cos(\theta))}$$

where theta is the half-angle of radiation of the lens. Most datasheets will report the full-angle, so be sure to divide by 2 before plugging into this formula.