Question 1138432
.
<pre>
Let n be that number under the question.

The price for 1 pig when the farmer bought them was  {{{100/n}}}.

The price for 1 pig when the farmer sold the rest (n-5) of them was  {{{150/(n-5)}}}.


The condition says that

    {{{150/(n-5)}}} - {{{100/n}}} = 5   dollars per pig.


Simplify

    {{{30/(n-5)}}} - {{{20/n}}} = 1.


The solution is seen by an unarmed eye: it is n = 20.


If you need formal solution, here it is step by step.


    30n - 20*(n-5) = n*(n-5)

    30n - 20n + 100 = n^2 - 5n

    n^2 -15n - 100 = 0

    (n-20)*(n+5) = 0.


The roots are 20 and -5, and only positive root is a meaningful solution.


<U>ANSWER</U>.  20 pigs.
</pre>

Solved.