This question was asked in Ex 5.2, 10
How to redefine gint function piece wise
Ritu Nanda's image