How do I calculate internal rate of return (IRR) and yield to maturity (YTM) in Maxima? I am trying to calculate the YTM of a bond of $1000 face value that pays $50 in coupons every year. The bond is currently selling for $900, and matures in 3 years. Using the formula for the YTM:
900 = [50 / (1 + r)] + [50 / (1 + r)^2] + [50 / (1 + r)^3] + [1000 / (1 + r)^3]
How do I use Maxima to solve for r
, the YTM?