As in a grammar it was written that when a number precede thousand and hundred we usually do use plural form of "thousand" and "hundred" such as "two hundred" or "three thosand".

But ,while doing an excercise in math I have to expand number

4375= 4 thousands + 3 hundreds + 7 tesns + 5 ones.

Why hare "thousands" and "hundreds" have been used?

There is no necessary accounting for mathematical terminology, any more than there is for that of any other English for Special Purposes, in terms of accepted grammar.

However, I would suggest that we are not talking about numbers in the normal sense (like 4 thousand soldiers), but are speaking of what is called the 'thousands' position (the fourth from the right) in the decimal number system-- that is, the position where thousands appear, whatever the quantity we have of them (3, 4, 5, or whatever).

Does that help?