The widespread deployment of residential distributed photovoltaic (RDPV) remains complex and challenging due to photovoltaic output intermittency, fluctuating electricity demand, and rising electric vehicle (EV) adoption. Simultaneously, the energy storage capabilities of EVs and residential demand response (DR) offer solutions for optimizing RDPV applications. This study proposes an integrated RDPV capacity planning model by encompassing EV charging, vehicle-to-home, and flexible load DR. Five scenarios are established to reveal the impact of various factors on the optimal photovoltaic installation capacity, electricity cost, self-consumption and self-sufficiency rate. A case study of three typical residential electricity demand patterns indicates that DR and vehicle-to-home significantly reduce the optimal photovoltaic installation capacity and total electricity cost. When the feed-in tariff during photovoltaic generation periods is higher than the off-peak pricing, DR results in a reduction in photovoltaic self-sufficiency rate and an increase in photovoltaic self-consumption rate. EV charging and vehicle-to-home have minimal impact on photovoltaic self-consumption rate, while EV charging significantly decreases self-sufficiency rate and vehicle-to-home exacerbates this effect.