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