document.write( "Question 1038295: A farmer bought a number of pigs for $145. However, 8 of them died before he could sell the rest at a profit of 2 per pig. His total profit was $2. How many pigs did he originally buy? \n" ); document.write( "
Algebra.Com's Answer #652996 by Edwin McCravy(20056)\"\" \"About 
You can put this solution on YOUR website!
A farmer bought a number of pigs for $145.
He bought \"n\" pigs.\r\n" );
document.write( "\r\n" );
document.write( "Each cost him \"145%2Fn\" dollars
...8 of them died...
So he only had n-8 live pigs to sell.
...sell the rest at a profit of $2 per pig.
He sold the \"n-8\" live pigs for \"145%2Fn+%2B+2\" dollars each.\r\n" );
document.write( "\r\n" );
document.write( "So he sold all \"n-8\" live pigs for \"%28n-8%29%28145%2Fn%2B2%29\" dollars, \r\n" );
document.write( "\r\n" );
document.write( "and so his total profit on all the pigs living or dead was\r\n" );
document.write( "\r\n" );
document.write( "\"%28n-8%29%28145%2Fn%2B2%29-145\" dollars
His total profit was $2.
We set those equal:\r\n" );
document.write( "\r\n" );
document.write( "\"%28n-8%29%28145%2Fn%2B2%29-145\"\"%22%22=%22%22\"\"2\"\r\n" );
document.write( "\r\n" );
document.write( "\"145%2B2n-1160%2Fn-16-145\"\"%22%22=%22%22\"\"2\"\r\n" );
document.write( "\r\n" );
document.write( "\"2n-1160%2Fn-16\"\"%22%22=%22%22\"\"2\"\r\n" );
document.write( "\r\n" );
document.write( "\"2n-1160%2Fn-18\"\"%22%22=%22%22\"\"0\"\r\n" );
document.write( "\r\n" );
document.write( "Multiply through by n\r\n" );
document.write( "\r\n" );
document.write( "\"2n%5E2-1160-18n\"\"%22%22=%22%22\"\"0\"\r\n" );
document.write( "\r\n" );
document.write( "Divide through by 2:\r\n" );
document.write( "\r\n" );
document.write( "\"n%5E2-580-9n\"\"%22%22=%22%22\"\"0\"\r\n" );
document.write( "\r\n" );
document.write( "rearrange in descending powers:\r\n" );
document.write( "\r\n" );
document.write( "\"n%5E2-9n-580\"\"%22%22=%22%22\"\"0\"\r\n" );
document.write( "\r\n" );
document.write( "\"%28n-29%29%28n%2B20%29\"\"%22%22=%22%22\"\"0\"\r\n" );
document.write( "\r\n" );
document.write( "\"matrix%282%2C2%2C%0D%0A%0D%0A+++n-29=0%2Cn%2B20=0%2C%0D%0A++++n=29%2C+n=-20%29\"\r\n" );
document.write( "\r\n" );
document.write( "He had 29 pigs to begin with.\r\n" );
document.write( "\r\n" );
document.write( "Checking:\r\n" );
document.write( "\r\n" );
document.write( "He bought 29 pigs for $145.\r\n" );
document.write( "So he paid $5 per pig.\r\n" );
document.write( "8 pigs died.\r\n" );
document.write( "He had 21 pigs left.\r\n" );
document.write( "He made a profit of $2 on each pig sold.\r\n" );
document.write( "So he sold each pig for $7\r\n" );
document.write( "He took in 21 times $7 or $147.\r\n" );
document.write( "He paid $149 for all the pigs living or dead.\r\n" );
document.write( "He made $149-$147=$2 profit total. \r\n" );
document.write( "\r\n" );
document.write( "So 29 is correct.  He bought 29 pigs.\r\n" );
document.write( "\r\n" );
document.write( "Edwin
\n" ); document.write( "
\n" );