x = seq( -2, +2, length.out=200 ) y_4_terms = -3 * ( 1 + x^2 / 2 + x^3 / 6 ) + 2 * x plot( x, y_4_terms, type='l', col='red' ) y_5_terms = -3 * ( 1 + x^2 / 2 + x^3 / 6 + x^4 / 24 ) + 2 * x lines( x, y_5_terms, type='l', col='blue' ) grid() legend( 'bottomright', c('4 terms', '5 terms'), lwd=2, lty=c(1,1), col=c('red', 'blue') )