Updated test cpp file
Fixed derivative to handle composite derivatives
Changed slightly the syntaxes