if( !require('NLRoot') ){ install.packages('NLRoot') } library(NLRoot) # Plot the region where the argument of the square root is positive: # x = seq( -4, 5.5, length.out=500 ) y = function(x){ 13 + 4*x^3 - 4*exp(x) } ys = y(x) plot( x, ys, type='l' ) abline(h=0, col='blue') grid() BFfzero( y, -2.0, 0 ) BFfzero( y, 4.0, 5.0 ) #postscript("../../WriteUp/Graphics/Chapter2/chap_2_sect_2_prob_17_plot.eps", onefile=FALSE, horizontal=FALSE) x = seq( -1.43, 4.6, length.out=100 ) y = function(x){ ( 5 - sqrt( 13 + 4*x^3 - 4*exp(x) ) )/2 } ys = y(x) plot( x, ys, type='l', xlab='x', ylab='y(x)' ) grid() #dev.off()