funcion por partes o a trozos