Siano F: x → A·x+B se x < 0, x → exp(x) se x ≥ 0,
exp(0)=1: affinché F sia continua deve essere A·0+B=1, ossia B=1; affinchè sia anche derivabile, dato che exp'(0)=exp(0)=1 e che Dx(A·x+1)=A, deve essere A=1.
log(1)=0: affinché G sia continua deve essere P·1+Q=0, ossia P=−Q; affinchè sia anche derivabile, dato che log'(1)=1/1=1 e che Dx(−Q·x+Q)=−Q, deve essere Q=−1, P=1.
source("http://macosa.dima.unige.it/r.R") # I grafici nei casi della derivabilità: F = function(x) ifelse(x < 0, A*x+B, exp(x)) G = function(x) ifelse(x < 1, P*x+Q, log(x)) BF=2.5; HF=2.5 PLANE(-2,2, -1,3); A = 1; B = 1 graph2(F,-2,0, "black"); graph2(F,0,2, "red") # PLANE(-2,2, -1,3); A = 0; B = 1 graph2(F,-2,0, "black"); graph2(F,0,2, "red") A = -1; graph2(F,-2,0, "black") # PLANE(-1,3, -2,2); P = 0; Q = 0 graph2(G,-1,1, "black"); graph2(G,1,3, "red") P = -1; Q = 1 graph2(G,-1,1, "black"); graph2(G,1,3, "red") # PLANE(-1,3, -2,2); P = 1; Q = -1 graph2(G,-1,1, "black"); graph2(G,1,3, "red")