© 2020 CERN, for the LHCb Collaboration. Published by the American Physical Society under the terms of the https://creativecommons.org/licenses/by/4.0/ Creative Commons Attribution 4.0 International license. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI. Funded by SCOAP 3 . Observations are reported of different sources of CP violation from an amplitude analysis of B+→π+π+π- decays, based on a data sample corresponding to an integrated luminosity of 3 fb-1 of pp collisions recorded with the LHCb detector. A large CP asymmetry is observed in the decay amplitude involving the tensor f2(1270) resonance, and in addition significant CP violation is found in the π+π-S wave at low invariant mass. The presence of CP violation related to interference between the π+π-S wave and the P wave B+→ρ(770)0π+ amplitude is also established; this causes large local asymmetries but cancels when integrated over the phase space of the decay. The results provide both qualitative and quantitative new insights into CP -violation effects in hadronic B decays.