converting sum of consumption basket to integral In our lecture, first we had expenditure of consumption basket as $\sum_{i=1}^{n} p_{i}c_{i} $ but later my professor converted it to $\int_{0}^{1}p_{i}c_{i}di$. I want to understand how she did this? And how can I differentiate $\int_{0}^{1}p_{i}c_{i}di$ with respect $c_{i}$
This is because there’s a relationship between summation and integrals. An integral is basically a way how to calculate an area under the curve. With right sum you can do the same thing. For example, mathematically 

$$ \sum_{i=0}^n f(i) \approx \int_0^n f(x)dx $$

In fact under the Reimann’s definition of integral, integrals are literary defined as a limit of a sum of function output multiplied by change of x or:

$$\int_a^b f(x)dx = \lim \sum_{i=0}^{n-1} f(\xi_i) \Delta x_i$$

Now to go back to your question you can imagine $p_i c_i$ as an area of rectangle of height $p_i$ and base $c_i$. Consequently $\sum p_i c_i$ can be considered an adding of of all areas of these rectangles and $\int p_i c_i di $ is just continuous approximation of this area.